/* ============================================
   MASTER CSS - Mohammed Alotaibi Portfolio
   Theme: Enterprise Integration Specialist
   ============================================ */

:root {
    /* Colors */
    --primary-color: #0f2b5e;
    --primary-light: #1e4a8a;
    --primary-glow: #3b82f6;
    --secondary-color: #1e293b;
    --accent-color: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --light-color: #f1f5f9;
    --dark-color: #0f172a;
    --text-color: #334155;
    --text-light: #64748b;
    --white: #ffffff;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 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);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-mono: 'Courier New', monospace;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #020617;
    --surface: #0f172a;
    --surface-2: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --primary: #60a5fa;
    --primary-light: #3b82f6;
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.site-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light), #1e40af);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path fill="rgba(255,255,255,0.05)" d="M0 0h200v200H0z"/><circle cx="100" cy="100" r="80" fill="rgba(255,255,255,0.03)"/><circle cx="100" cy="100" r="50" fill="rgba(255,255,255,0.02)"/></svg>');
    background-size: 200px;
    opacity: 0.5;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
}

.site-header h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-header .tagline {
    font-size: 1.3rem;
    margin-bottom: 32px;
    font-weight: 400;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Badges */
.badge-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.badge {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.social-links a {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.social-links a:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    border-color: transparent;
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */
.site-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 40px;
    transition: all 0.3s ease;
}

.nav-links li a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.nav-links li a.active {
    background: var(--primary-color);
    color: white;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary-color);
    background: none;
    border: none;
}

/* ============================================
   PAGE HERO (for subpages)
   ============================================ */
.page-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.5rem;
    margin: 16px 0;
    -webkit-text-fill-color: white;
    background: none;
}

.page-hero .lead {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    display: inline-block;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 0.7;
}

/* ============================================
   SECTION STYLES
   ============================================ */
section {
    padding: 80px 0;
}

.bg-light {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.section-title {
    text-align: center;
    margin-bottom: 56px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-glow));
    border-radius: 3px;
}

.section-title p {
    color: var(--text-light);
    max-width: 600px;
    margin: 20px auto 0;
}

/* ============================================
   CARD STYLES
   ============================================ */
.account-card, .project-card, .card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.account-card:hover, .project-card:hover, .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.account-card {
    text-align: left;
}

.account-icon, .project-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.account-card h3, .project-card h3, .card h3 {
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.account-card p, .project-card p, .card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Grids */
.accounts-grid, .projects-grid {
    display: grid;
    gap: 24px;
}

.accounts-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-success {
    background: var(--accent-color);
}

.btn-success:hover {
    background: #0d9488;
}

.btn-warning {
    background: var(--accent-orange);
}

.btn-warning:hover {
    background: #d97706;
}

/* ============================================
   SKILLS & TAGS
   ============================================ */
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.skill, .project-tag, .tag {
    background: linear-gradient(135deg, var(--light-color), #fff);
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
    border: 1px solid rgba(0,0,0,0.05);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tag {
    padding: 4px 12px;
    font-size: 0.7rem;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-year {
    min-width: 100px;
    font-weight: 700;
    color: var(--primary-light);
}

.timeline-content h3 {
    margin-bottom: 6px;
}

.timeline-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================
   LINUX GUIDE TABLE
   ============================================ */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 32px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: var(--light-color);
}

.modern {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.legacy {
    color: var(--accent-orange);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.category {
    font-weight: 600;
    color: var(--primary-color);
}

/* Pro Tip Box */
.pro-tip {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-top: 32px;
    text-align: center;
}

.pro-tip code {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--font-mono);
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-container {
    display: flex;
    gap: 48px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    margin-bottom: 24px;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.contact-details {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    margin-right: 16px;
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 24px;
}

.contact-item a {
    color: var(--text-color);
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--primary-color);
}

.contact-form {
    flex: 1;
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 43, 94, 0.1);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* ============================================
   RADIO / QURAN PAGE
   ============================================ */
.radio-panel {
    background: linear-gradient(135deg, #064e3b, var(--accent-color));
    color: white;
}

.radio-panel .btn-secondary {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.radio-panel .btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

.audio-box {
    width: 100%;
    margin: 20px 0;
    border-radius: 40px;
}

.arabic {
    font-size: 2rem;
    text-align: center;
    font-family: 'Amiri', 'Times New Roman', serif;
    margin: 20px 0;
    direction: rtl;
}

.stream-selector {
    margin: 15px 0;
    padding: 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.stream-selector select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* File List */
.file-list {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.file-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.file-link:hover {
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.file-link span {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Radio Status */
.radio-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.3s ease;
}

.radio-status.playing {
    background: rgba(255,255,255,0.2);
}

.radio-status.error {
    background: rgba(220,38,38,0.3);
}

.radio-status.loading {
    background: rgba(245,158,11,0.3);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 48px 0 32px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    opacity: 0.7;
    font-size: 0.85rem;
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    border: none;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 968px) {
    .command-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .site-header h1 {
        font-size: 2.2rem;
    }
    
    .site-header .tagline {
        font-size: 1rem;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        transition: left 0.3s ease;
        z-index: 99;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 15px 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .contact-container {
        flex-direction: column;
    }
    
    section {
        padding: 50px 0;
    }
    
    .accounts-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    .modern, .legacy {
        font-size: 0.7rem;
    }
    
    .file-link {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* Print Styles */
@media print {
    .site-nav,
    .site-footer,
    .scroll-top,
    .actions,
    .badge-group,
    .social-links {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


/* Component include placeholders */
[data-include] { display: contents; }

/* Backward compatibility for pages that used raw tags */
header:not(.site-header) { background: inherit; }
footer:not(.site-footer) { background: inherit; }

/* Page spacing after included footer */
.site-footer { margin-top: 64px; }

/* External-link safety */
a[target="_blank"] { word-break: break-word; }
