/* ============================================
   EB IT Support Mobile App - Stylesheet
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    max-width: 100%;
    min-height: 100vh;
    background: var(--bg-secondary);
    padding-bottom: 2rem;
}

/* App Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-logo {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Install Prompt */
.install-prompt {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.install-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
}

.install-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.install-text p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.install-btn {
    background: white;
    color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.dismiss-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* System Notice */
.system-notice {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1rem;
    animation: slideDown 0.3s ease;
}

.notice-content {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notice-text {
    flex: 1;
}

.notice-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.notice-text p {
    font-size: 0.875rem;
    opacity: 0.95;
    margin: 0;
}

.notice-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Status Widget */
.status-widget {
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.status-widget iframe {
    display: block;
    width: 100%;
}

/* Quick Actions */
.quick-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.action-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.action-card svg {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.action-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.action-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.action-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Sections */
section {
    background: white;
    margin: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Search Section */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-btn:active {
    background: var(--primary-dark);
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Ticket Section */
.ticket-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.primary-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.primary-btn:active {
    background: var(--primary-dark);
}

.primary-btn svg {
    width: 20px;
    height: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    margin-top: 2rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:active {
    background: var(--bg-secondary);
}

.modal-body {
    padding: 0;
}

.modal-body iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 0 0 12px 12px;
}

/* Quick Links */
.link-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.link-item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.link-item:active {
    background: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

.link-item svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.link-item:active svg {
    color: white;
}

.link-item span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.app-footer .small {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.app-footer .version {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Responsive */
@media (min-width: 768px) {
    .app-container {
        max-width: 600px;
        margin: 0 auto;
        box-shadow: var(--shadow-lg);
    }

    section {
        margin: 1rem 0;
    }

    .quick-actions {
        padding: 1rem 0;
    }

    .link-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --border-color: #374151;
    }

    body {
        background: var(--bg-secondary);
    }

    .app-container {
        background: var(--bg-secondary);
    }

    section,
    .action-card {
        background: var(--bg-primary);
    }

    .suggestion-btn,
    .link-item {
        background: #1f2937;
        border-color: var(--border-color);
    }

    .modal-content {
        background: var(--bg-primary);
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Safe Area Insets (iPhone notch, etc) */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(1.5rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .app-footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}
