/* ============================================================================
   CORE.CSS - Universal styles loaded on ALL pages
   Minimal file size - only truly universal elements
   ============================================================================ */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
}

/* Typography */
h1 {
    margin-bottom: 20px;
    font-size: 2em;
    color: #333;
    text-align: center;
}

h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 12px;
    font-weight: 600;
}

.help-text {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-green {
    background: linear-gradient(135deg, #52c41a 0%, #45a017 100%);
}

.btn-red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
}

.btn-orange {
    background: linear-gradient(135deg, #ff9500 0%, #e6850e 100%);
}

.btn-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-direction: column;
    margin: 10px 0;
}

/* Forms */
.edit-textarea,
.depot-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.2s;
}

.edit-textarea:focus,
.depot-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #667eea;
}

.toast.success {
    border-left-color: #52c41a;
}

.toast.error {
    border-left-color: #ff6b6b;
}

.toast.warning {
    border-left-color: #ff9500;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    white-space: pre-line;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #666;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.processing-overlay.show {
    display: flex;
}

.processing-content {
    background: white;
    border-radius: 15px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error Messages */
.error-message {
    background: #ff6b6b;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    display: none;
    font-size: 13px;
}

.error-message.show {
    display: block;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (min-width: 480px) {
    body {
        padding-bottom: 15px;
    }

    h1 {
        font-size: 2.5em;
    }

    .button-row {
        flex-direction: row;
    }

    .button-row .btn {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        padding: 14px 16px;
    }

    .toast-icon {
        font-size: 20px;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 12px;
    }
}