/**
 * LookEyes User Preferences Styling
 * Styles for customizable message colors and preferences modal
 */

/* ===========================
   Message Container & Messages
   =========================== */

#message-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

#message-container > * {
    pointer-events: auto;
}

.welcome-message,
.success-message,
.info-message,
.error-message {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-width: 2px;
    border-style: solid;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.welcome-message {
    background-color: var(--message-bg-color, #d1fae5);
    color: var(--message-color, #10b981);
    border-color: var(--message-color, #10b981);
}

.success-message {
    background-color: #d1fae5;
    color: #10b981;
    border-color: #10b981;
}

.info-message {
    background-color: #dbeafe;
    color: #3b82f6;
    border-color: #3b82f6;
}

.error-message {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #ef4444;
}

/* ===========================
   Message Styles
   =========================== */

/* Modern Style (default) */
.style-modern {
    border-radius: 12px;
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Classic Style */
.style-classic {
    border-radius: 4px;
    border-width: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Georgia', serif;
}

/* Minimal Style */
.style-minimal {
    border-radius: 0;
    border-width: 0;
    border-left-width: 4px;
    box-shadow: none;
    background-color: transparent !important;
    backdrop-filter: blur(10px);
}

/* ===========================
   Animations
   =========================== */

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.animate-slide-in {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* ===========================
   Preferences Modal
   =========================== */

.preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.preferences-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.preferences-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.preferences-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.preferences-modal.active .preferences-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.preferences-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-align: center;
}

/* ===========================
   Preference Groups
   =========================== */

.preference-group {
    margin-bottom: 20px;
}

.preference-group > label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preference-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.preference-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preference-group select:hover,
.preference-group select:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.15);
    outline: none;
}

.preference-group select option {
    background-color: #5a67d8;
    color: white;
}

/* ===========================
   Color Picker
   =========================== */

.color-picker-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-picker-group input[type="color"] {
    width: 60px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background-color: transparent;
    transition: all 0.3s ease;
}

.color-picker-group input[type="color"]:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.color-picker-group input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.color-picker-group input[type="text"]:hover,
.color-picker-group input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.15);
    outline: none;
}

.color-picker-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.color-picker-group input[type="text"]:invalid {
    border-color: #ef4444;
}

/* ===========================
   Preview
   =========================== */

.preference-preview {
    margin: 24px 0;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.preference-preview strong {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-message {
    padding: 12px 16px;
    border-radius: 8px;
    border-width: 2px;
    border-style: solid;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* ===========================
   Modal Buttons
   =========================== */

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: white;
    color: #667eea;
}

.btn-primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    #message-container {
        top: 60px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .preferences-modal-content {
        width: 95%;
        padding: 24px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .preferences-modal-content h2 {
        font-size: 24px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-buttons button {
        width: 100%;
    }

    .color-picker-group {
        flex-direction: column;
        align-items: stretch;
    }

    .color-picker-group input[type="color"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome-message,
    .success-message,
    .info-message,
    .error-message {
        font-size: 14px;
        padding: 12px 16px;
    }

    .preferences-modal-content {
        padding: 20px;
    }

    .preferences-modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* ===========================
   Dark Mode Support
   =========================== */

@media (prefers-color-scheme: dark) {
    .preferences-modal-content {
        background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
    }
}

/* ===========================
   Print Styles
   =========================== */

@media print {
    #message-container,
    .preferences-modal {
        display: none !important;
    }
}
