/* Custom Premium Dark/Glassmorphic Style System for sdanielch */

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0; /* Darker secondary made brighter for accessibility */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #475569;
    --secondary-hover: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --info: #0ea5e9;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-sans: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    font-size: 1.05rem ; /* Increased base size for accessibility */
    line-height: 1.6;
}

/* Accessibility Font Sizes & Contrast */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

p, span, li, td {
    font-size: 1.05rem; /* Ensure minimum text readable size */
}

small, .text-small, .sql-meta, .shortcuts-label {
    font-size: 0.95rem !important; /* Increased from 0.8rem for accessibility */
}

/* Nav Bar Styling (Landing Page) */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    max-width: 100% !important;
}

.top-nav-title a {
    font-size: 1.7rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    background: linear-gradient(to right, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity var(--transition-fast);
}

.top-nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.top-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: color var(--transition-fast);
}

.top-nav-links a:hover,
.top-nav-links a.active {
    color: var(--text-primary);
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    border-radius: 20px;
    font-size: 1rem;
}

.nav-user-info .username-label {
    font-weight: 700;
    color: var(--primary);
}

/* Back-Office Layout (Sidebar + Top Navbar) */
.backoffice-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Sidebar */
.backoffice-sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 90;
    transition: transform var(--transition-fast);
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--bg-card-border);
    text-align: center;
}

.sidebar-brand a {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(to right, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 2rem 1rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.05rem;
    transition: all var(--transition-fast);
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--bg-card-border);
}

/* Main Content Wrapper */
.backoffice-main {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
}

/* Top Header Bar */
.backoffice-header {
    height: 70px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bg-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 80;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.header-user-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Area */
.backoffice-content {
    padding: 2.5rem;
    flex-grow: 1;
}

/* Mobile Sidebar Adaptations */
@media (max-width: 768px) {
    .backoffice-sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    
    .backoffice-sidebar.active {
        transform: translateX(0);
    }
    
    .backoffice-main {
        margin-left: 0;
        width: 100%;
    }
    
    .backoffice-header {
        padding: 0 1rem;
    }
}

/* Portfolio CSS Classes */
.portfolio-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
    min-height: 60vh;
}

.portfolio-hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #a5b4fc, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.portfolio-hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.portfolio-skills {
    padding: 4rem 1.5rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 0.8rem auto 0 auto;
    border-radius: 2px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.skill-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.skill-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.skill-card h3 {
    margin: 0;
    font-size: 1.4rem;
}

.skill-card p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.skill-bar-container {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.skill-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary), #ec4899);
    border-radius: 4px;
}

/* Dashboard Summary Cards (Back-Office) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.info-card .card-header h3 {
    margin-top: 0;
    font-size: 1.35rem;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    align-items: center;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.05rem;
}

.info-value.highlight {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Form Controls (Accessible) */
.form-group label {
    font-size: 1.05rem;
    font-weight: 600;
}

.form-control {
    font-size: 1.05rem !important;
}

/* Table Controls (Accessible) */
.sql-table {
    font-size: 1.05rem !important;
}

.sql-table th {
    font-size: 1.05rem !important;
    padding: 0.9rem 1.1rem;
}

.sql-table td {
    font-size: 1.05rem !important;
    padding: 0.9rem 1.1rem;
}

/* General Layout Main wrapper padding */
.main {
    padding: 3rem 1.5rem;
}

/* CakePHP Default Flash Messages Styling */
.message {
    padding: 1.2rem 1.8rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.message.success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.message.error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Buttons */
.btn {
    font-size: 1.05rem;
    padding: 0.85rem 1.7rem;
    border-radius: var(--radius-md);
}

.btn-shortcut {
    font-size: 0.95rem; /* Raised for accessibility */
    padding: 0.5rem 1rem;
}

/* Auth Cards */
.auth-card {
    padding: 3rem;
}

/* Micro-animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hero Actions Helper Class */
.hero-actions {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
}

/* Responsive Overrides for Landing Page & Navbar */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        gap: 1.2rem;
        padding: 1.5rem 1rem !important;
    }
    
    .top-nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.2rem;
        width: 100%;
    }
    
    .portfolio-hero h1 {
        font-size: 2.8rem;
    }
    
    .portfolio-hero .subtitle {
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .top-nav-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .top-nav-links a {
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .top-nav-links .btn {
        width: 100% !important;
        text-align: center;
        box-sizing: border-box;
    }
    
    .portfolio-hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-actions {
        flex-direction: column !important;
        width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }
    
    .hero-actions a {
        width: 100% !important;
        text-align: center;
        box-sizing: border-box;
    }
}


.reveal {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range-start: entry 20%;
    animation-range-end: entry 80%;
}
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(80px) scale(0.8);
        filter: blur(12px)
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0)
    }
}