/* General Reset & Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    color: #4A5568; /* Gray-700 */
    overflow-y: auto;
}

/* Main Container */
.container {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2.5rem;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    margin: auto;
    min-height: fit-content;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
header {
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #2D3748; /* Gray-800 */
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.125rem;
    color: #718096; /* Gray-600 */
}

/* Notification Section */
.status-card {
    margin-bottom: 1.5rem;
}

.status-message {
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.status-message.granted {
    background-color: #E6FFFA; /* Teal-100 */
    border-color: #B2F5EA; /* Teal-200 */
    color: #234E52; /* Teal-900 */
}

.status-message.registered {
    background-color: #EBF8FF; /* Blue-100 */
    border-color: #BEE3F8; /* Blue-200 */
    color: #2A4365; /* Blue-900 */
}

.status-message.denied {
    background-color: #FFF5F5; /* Red-100 */
    border-color: #FED7D7; /* Red-200 */
    color: #742A2A; /* Red-900 */
}

.status-message.loading {
    background-color: #F7FAFC; /* Gray-100 */
    border-color: #EDF2F7; /* Gray-200 */
    color: #4A5568; /* Gray-700 */
    cursor: wait;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background-color: #4299E1; /* Blue-500 - Original color */
    color: white;
}

.btn-primary:disabled {
    background-color: #A0AEC0; /* Gray color when disabled */
    color: #cccccc;
}

.btn-secondary {
    background-color: #A0AEC0; /* Gray-500 - Original color */
    color: white;
}

.btn-success {
    background-color: #48BB78; /* Green-500 - Original color */
    color: white;
}

/* Preferences Section */
.preferences-section {
    margin-top: 2rem;
    text-align: left;
    border-top: 1px solid #E2E8F0; /* Gray-300 */
    padding-top: 2rem;
}

.preferences-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #2D3748; /* Gray-800 */
}

.preference-item {
    margin-bottom: 1rem;
}

.preference-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4A5568; /* Gray-700 */
}

.preference-item input,
.preference-item select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #CBD5E0; /* Gray-400 */
    border-radius: 0.5rem;
    font-size: 1rem;
}

.preference-item input:focus,
.preference-item select:focus {
    outline: none;
    border-color: #4299E1; /* Blue-500 */
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Center the save preferences button */
.preferences-section .btn {
    display: block;
    margin: 1.5rem auto 0 auto;
    width: fit-content;
}

/* Install instructions and button centering */
.install-instructions {
    text-align: center;
}

.install-instructions .btn {
    display: block;
    margin: 1.5rem auto;
    width: fit-content;
}

/* Footer */
footer {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: #A0AEC0; /* Gray-500 */
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #4A5568;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
    background: #48BB78; /* Green-400 */
}

.toast.toast-error {
    background: #F56565; /* Red-400 */
}

.toast.toast-info {
    background: #4299E1; /* Blue-400 */
}

/* Home Page Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.greeting-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.greeting-content {
    margin-bottom: 2rem;
}

.greeting-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: center;
}

.greeting-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.greeting-time {
    font-weight: 500;
}

.greeting-type {
    font-style: italic;
}

.greeting-actions {
    display: flex;
    justify-content: center;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.error-container {
    text-align: center;
    padding: 3rem 1rem;
}

.error-container p {
    color: #E53E3E;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Responsive Design for Home Page */
@media (max-width: 640px) {
    .greeting-text {
        font-size: 1.25rem;
    }
    
    .greeting-meta {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* RTL Support for Home Page */
[dir="rtl"] .greeting-meta {
    direction: rtl;
}

[dir="rtl"] .greeting-text {
    text-align: center;
}

[dir="rtl"] .action-buttons {
    direction: rtl;
}

/* Settings Icon Button */
.settings-icon-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.settings-icon-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.settings-icon-btn span {
    font-size: 1.2rem;
}

/* RTL Support for Settings Icon */
[dir="rtl"] .settings-icon-btn {
    left: auto;
    right: 1rem;
}

/*rtl styles*/
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .preferences-section {
    text-align: right;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
        align-items: center;
    }
    
    .container {
        padding: 1.5rem;
        margin: auto;
        border-radius: 1rem;
        max-height: calc(100vh - 1rem);
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    header p {
        font-size: 1rem;
    }
}

/* Additional mobile viewport fixes */
@media (max-height: 700px) {
    body {
        align-items: center;
        padding: 0.5rem;
    }
    
    .container {
        margin: auto;
        max-height: calc(100vh - 1rem);
    }
    
    header {
        margin-bottom: 1.5rem;
    }
} 