@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Open+Sans:wght@400;500;600&display=swap');

:root {
    /* Tekdi Alignment - Stability & Trust */
    --tekdi-charcoal: #2C3539;
    --stone-grey: #7F8C8D;
    
    /* Inkomic Accents - Creative Energy */
    --digital-indigo: #4B0082;
    --creative-cyan: #00BCE4;
    --story-magenta: #E91E63;
    
    /* Supporting Colors */
    --light-bg: #F8F9FA;
    --white: #FFFFFF;
}

* {
    font-family: 'Open Sans', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--digital-indigo) 0%, var(--tekdi-charcoal) 100%);
    min-height: 100vh;
    color: var(--tekdi-charcoal);
    padding-top: 0;
}

/* Sticky Header */
.inkomic-navbar {
    background: linear-gradient(135deg, var(--tekdi-charcoal) 0%, var(--digital-indigo) 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 999;
    padding: 12px 0;
}

.inkomic-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--creative-cyan) !important;
    letter-spacing: 0.5px;
}

.navbar-brand-subtext {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 400;
    margin-left: -0.5rem;
}

.navbar-brand-subtext::before {
    content: '|';
    margin-right: 0.5rem;
    opacity: 0.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.pen-title {
    color: var(--white);
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.5px;
}

.notebook-card {
    background: var(--white);
    border: 3px solid var(--tekdi-charcoal);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.notebook-card:hover {
    box-shadow: 0 12px 32px rgba(75, 0, 130, 0.2);
    transform: translateY(-2px);
}

.notebook-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--creative-cyan) 0%, var(--digital-indigo) 100%);
}

.notebook-card .card-body {
    background: var(--white);
    padding-left: 20px !important;
}

.notebook-card .card-header {
    background: linear-gradient(135deg, var(--tekdi-charcoal) 0%, var(--digital-indigo) 100%);
    color: var(--white);
    border: none;
    font-weight: 600;
}

.notebook-input {
    background: rgba(245, 245, 245, 0.5);
    border: 2px solid var(--stone-grey);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
    color: var(--tekdi-charcoal);
}

.notebook-input::placeholder {
    color: rgba(127, 140, 141, 0.7);
}

.notebook-input:focus {
    background: var(--white);
    border-color: var(--creative-cyan);
    box-shadow: 0 0 0 3px rgba(0, 188, 228, 0.15);
    outline: none;
}

.form-label {
    color: var(--tekdi-charcoal);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.form-text {
    color: var(--stone-grey);
    font-style: italic;
    font-size: 0.85rem;
}

.generate-btn {
    background: linear-gradient(135deg, var(--creative-cyan) 0%, var(--digital-indigo) 100%);
    border: none;
    color: var(--white);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 12px 30px;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 188, 228, 0.4);
    background: linear-gradient(135deg, var(--digital-indigo) 0%, var(--creative-cyan) 100%);
    color: var(--white);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--creative-cyan) 0%, var(--digital-indigo) 100%);
    border: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--digital-indigo) 0%, var(--creative-cyan) 100%);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--white);
    border-color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--white);
    color: var(--digital-indigo);
    border-color: var(--white);
}

.btn-outline-danger {
    color: var(--story-magenta);
    border-color: var(--story-magenta);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.btn-outline-danger:hover {
    background: var(--story-magenta);
    border-color: var(--story-magenta);
    color: var(--white);
}

.btn-outline-secondary {
    color: var(--tekdi-charcoal);
    border-color: var(--stone-grey);
    font-family: 'Poppins', sans-serif;
}

.btn-outline-secondary:hover {
    background: var(--stone-grey);
    border-color: var(--stone-grey);
    color: var(--white);
}

.btn-success {
    background: linear-gradient(135deg, var(--creative-cyan) 0%, #00a896 100%);
    border: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #00a896 0%, var(--creative-cyan) 100%);
}

.btn-outline-success {
    color: var(--creative-cyan);
    border-color: var(--creative-cyan);
    font-family: 'Poppins', sans-serif;
}

.btn-outline-success:hover {
    background: var(--creative-cyan);
    border-color: var(--creative-cyan);
    color: var(--white);
}

.btn-outline-info {
    color: var(--creative-cyan);
    border-color: var(--creative-cyan);
    font-family: 'Poppins', sans-serif;
}

.btn-outline-info:hover {
    background: var(--creative-cyan);
    border-color: var(--creative-cyan);
    color: var(--white);
}

.btn-info {
    background: var(--creative-cyan);
    border: none;
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.btn-info:hover {
    background: #0096b3;
    color: var(--white);
}

.loading-container {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--creative-cyan);
}

.spinner-grow {
    color: var(--creative-cyan);
}

.progress-bar {
    background: linear-gradient(90deg, var(--creative-cyan) 0%, var(--digital-indigo) 100%);
}

.comic-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--tekdi-charcoal);
}

.script-display {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-left: 3px solid var(--creative-cyan);
}

.comic-thumbnail {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.comic-thumbnail:hover {
    transform: scale(1.03);
}

.gallery-card {
    transition: transform 0.2s ease;
}

.gallery-card:hover .comic-thumbnail {
    transform: scale(1.02);
}

/* Gallery Modal Styling */
.gallery-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    overflow: hidden;
    padding: 20px;
}

.gallery-modal.show {
    display: flex !important;
}

.gallery-modal-content {
    background: var(--white);
    max-width: 900px;
    width: 100%;
    max-height: calc(100vh - 80px);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--tekdi-charcoal);
    position: relative;
}

.gallery-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    background: rgba(75, 0, 130, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tekdi-charcoal);
    transition: all 0.3s ease;
    z-index: 1001;
}

.gallery-modal-close:hover {
    background: var(--story-magenta);
    color: var(--white);
    transform: scale(1.1);
}

.gallery-modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--tekdi-charcoal) 0%, var(--digital-indigo) 100%);
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.gallery-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 60vh;
    padding: 20px;
    background: var(--light-bg);
    overflow: auto;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.gallery-modal-footer {
    padding: 12px 20px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid var(--stone-grey);
    flex-shrink: 0;
}

.gallery-modal-actions {
    padding: 12px 20px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid var(--stone-grey);
    flex-shrink: 0;
}

/* Alert Styling */
.alert-danger {
    background: rgba(233, 30, 99, 0.95);
    border: 2px solid var(--story-magenta);
    color: var(--white);
}

.alert-danger .alert-heading {
    color: var(--white);
    font-weight: 700;
}

.alert-danger p {
    color: rgba(255, 255, 255, 0.9);
}

.alert-danger hr {
    border-color: rgba(255, 255, 255, 0.3);
}

.alert-info {
    background: rgba(0, 188, 228, 0.95);
    border: 2px solid var(--creative-cyan);
    color: var(--white);
}

.alert-info .alert-heading {
    color: var(--white);
    font-weight: 700;
}

/* Buttons - Brand Aligned */
.btn-primary {
    background: linear-gradient(135deg, var(--creative-cyan) 0%, var(--digital-indigo) 100%) !important;
    border: none !important;
    color: var(--white) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 188, 228, 0.4) !important;
}

.btn-danger {
    background: var(--story-magenta) !important;
    border: none !important;
    color: var(--white) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.4) !important;
    background: #c2185b !important;
}

.btn-outline-primary {
    color: var(--creative-cyan) !important;
    border-color: var(--creative-cyan) !important;
}

.btn-outline-primary:hover {
    background: var(--creative-cyan) !important;
    border-color: var(--creative-cyan) !important;
    color: var(--white) !important;
}

.btn-success {
    background: #4CAF50 !important;
    border: none !important;
    color: var(--white) !important;
    font-weight: 600;
}

.btn-success:hover {
    background: #45a049 !important;
}

.btn-outline-secondary {
    color: var(--stone-grey) !important;
    border-color: var(--stone-grey) !important;
}

.btn-outline-secondary:hover {
    background: var(--stone-grey) !important;
    border-color: var(--stone-grey) !important;
    color: var(--white) !important;
}

.btn-outline-light {
    color: var(--white) !important;
    border-color: var(--white) !important;
}

.btn-outline-light:hover {
    background: var(--creative-cyan) !important;
    border-color: var(--creative-cyan) !important;
    color: var(--tekdi-charcoal) !important;
}

/* Form Check */
.form-check-input:checked {
    background-color: var(--creative-cyan);
    border-color: var(--creative-cyan);
}

.form-check-input:focus {
    border-color: var(--creative-cyan);
    box-shadow: 0 0 0 0.25rem rgba(0, 188, 228, 0.25);
}

/* Select Input */
.form-select {
    border-color: var(--stone-grey);
}

.form-select:focus {
    border-color: var(--creative-cyan);
    box-shadow: 0 0 0 0.25rem rgba(0, 188, 228, 0.25);
}

/* Tekdi Footer */
.tekdi-footer {
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -20px;
    padding-left: 12px;
    padding-right: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.tekdi-link {
    color: var(--creative-cyan);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.tekdi-link:hover {
    color: var(--white);
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 188, 228, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .pen-title {
        font-size: 2rem;
    }
    
    .notebook-card::before {
        width: 3px;
    }
    
    .notebook-card .card-body {
        padding-left: 15px !important;
    }
    
    .gallery-modal-content {
        max-width: 95%;
        max-height: 95vh;
        padding: 20px;
    }
    
    .gallery-modal-body {
        min-height: 300px;
    }
    
    .gallery-modal-footer {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .gallery-modal-actions {
        flex-wrap: wrap;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 10px;
    }
}
