/* =====================================================
   DevAlix Portfolio - Custom Styles
   ===================================================== */

:root {
    --sunrise-orange: #E67451;
    --sunrise-blue: #2B4C7E;
    --dawn-blue: #5B8DBE;
    --sky-light: #E8F1F8;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom gradient background */
.bg-gradient-sunrise {
    background: linear-gradient(135deg, #E67451 0%, #5B8DBE 100%);
}

/* Modal Styles */
dialog {
    padding: 0;
    border: none;
    background: transparent;
    max-width: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background: transparent;
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    padding: 0;
}

/* Hide scrollbar for Webkit browsers (Chrome, Edge, Safari) */
.modal-container::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Firefox */
.modal-container {
    scrollbar-width: none;
}

/* Hide scrollbar for IE and Edge Legacy */
.modal-container {
    -ms-overflow-style: none;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #E67451 0%, #5B8DBE 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: bold;
}

.modal-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.modal-header button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    background: white;
    position: relative;
    z-index: 2;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.08);
}

.modal-body h3 {
    color: var(--sunrise-blue);
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    color: #4b5563;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.modal-body ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.modal-body ul li {
    color: #4b5563;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.modal-body ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--sunrise-orange);
    font-weight: bold;
}

/* Screenshot container in modal with floating effect */
.modal-screenshot-container {
    position: relative;
    width: 100%;
    margin-bottom: -3rem;
    padding: 0;
    z-index: 1;
}

.modal-screenshot {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Architecture image in modal */
.modal-architecture {
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

.modal-architecture img {
    width: 100%;
    height: auto;
    display: block;
}

/* Badge styles */
.badge-ci {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--sky-light);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.25rem;
}

.badge-ci.success {
    background-color: #d1fae5;
    color: #065f46;
}

/* Timeline styles */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #E67451 0%, #5B8DBE 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background-color: var(--sunrise-orange);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--sky-light);
}

/* Timeline branch marker (split) */
.timeline-marker-split {
    background: linear-gradient(135deg, #E67451 0%, #5B8DBE 100%);
    width: 2rem;
    height: 2rem;
    left: -2.75rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px var(--sky-light), 0 0 20px rgba(230, 116, 81, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px var(--sky-light), 0 0 30px rgba(230, 116, 81, 0.5);
    }
}

/* Branches wrapper */
.branches-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .branches-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* Branch cards */
.branch {
    position: relative;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: white;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.branch-primary {
    border-color: var(--sunrise-orange);
    background: linear-gradient(135deg, rgba(230, 116, 81, 0.05) 0%, rgba(91, 141, 190, 0.05) 100%);
}

.branch-secondary {
    border-color: var(--dawn-blue);
    background: linear-gradient(135deg, rgba(91, 141, 190, 0.05) 0%, rgba(43, 76, 126, 0.05) 100%);
}

.branch:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.branch-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.branch-primary .branch-badge {
    background-color: var(--sunrise-orange);
    color: white;
}

.branch-secondary .branch-badge {
    background-color: var(--dawn-blue);
    color: white;
}

.branch-title {
    color: var(--sunrise-blue);
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.branch-subtitle {
    color: var(--sunrise-orange);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.branch-description {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.branch-description li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

.branch-description li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--sunrise-orange);
    font-weight: bold;
}

.timeline-cta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.timeline-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-date {
    color: var(--sunrise-orange);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.timeline-title {
    color: var(--sunrise-blue);
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #6b7280;
    line-height: 1.625;
}

/* Skill grid */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skill-category h3 {
    color: var(--sunrise-blue);
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.skill-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-category ul li {
    padding: 0.5rem 0;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category ul li:before {
    content: "▸";
    color: var(--sunrise-orange);
    font-weight: bold;
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-container {
        max-height: 95vh;
        border-radius: 0.5rem;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline::before {
        left: 0.5rem;
    }

    .timeline-marker {
        left: -1.75rem;
        width: 1rem;
        height: 1rem;
    }
}

/* Utility classes */
.section-title {
    color: var(--sunrise-blue);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.security-list {
    list-style: none;
    padding: 0;
}

.security-list li {
    padding: 0.5rem 0;
    color: #4b5563;
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    z-index: 10001;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-image-container {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* Mobile optimizations for lightbox */
@media (max-width: 768px) {
    .lightbox-image-container {
        width: 100%;
        overflow-x: auto;
        overflow-y: auto;
    }

    .lightbox-image {
        max-width: none;
        max-height: none;
        width: auto;
        height: auto;
        min-width: 100%;
    }

    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }
}

/* Print styles */
@media print {
    nav {
        display: none;
    }

    .modal-overlay {
        display: none !important;
    }

    .image-lightbox {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }
}
