/**
 * E-Magazine Platform Custom Styles
 * 
 * Custom CSS for the e-magazine platform
 */

/* ============================================
   Global Styles
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ============================================
   Magazine Cards
   ============================================ */

.magazine-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.magazine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.magazine-cover {
    height: 350px;
    object-fit: contain;
    background-color: #f8f9fa;
    width: 100%;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   Authentication Pages
   ============================================ */

.auth-container {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Flipbook Viewer
   ============================================ */

.flipbook-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    background-color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#flipbook {
    margin: 0 auto;
}

.flipbook-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 1000;
}

.flipbook-controls button {
    background-color: transparent;
    border: 2px solid #fff;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.flipbook-controls button:hover {
    background-color: #fff;
    color: #000;
}

.flipbook-controls .page-info {
    color: #fff;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* ============================================
   Admin Panel
   ============================================ */

.admin-sidebar {
    min-height: calc(100vh - 56px);
    background-color: #343a40;
    padding: 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #0d6efd;
}

.admin-sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

.admin-content {
    padding: 2rem;
}

.admin-header {
    background-color: #fff;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ============================================
   Tables
   ============================================ */

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.table-thumbnail {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}

/* ============================================
   Forms
   ============================================ */

.form-label {
    font-weight: 600;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ============================================
   Loading Spinner
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.4rem solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .magazine-cover {
        height: 300px;
    }
    
    .flipbook-container {
        height: calc(100vh - 100px);
    }
    
    .flipbook-controls {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .flipbook-controls button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
    
    .admin-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .magazine-cover {
        height: 250px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .flipbook-controls .page-info {
        min-width: 60px;
        font-size: 0.9rem;
    }
}

/* ============================================
   Grid - 5 Columns
   ============================================ */

/* 5 column grid for XL screens */
@media (min-width: 1200px) {
    .col-xl-2-4 {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.text-truncate-3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .navbar,
    .flipbook-controls,
    .admin-sidebar,
    footer {
        display: none !important;
    }
    
    .flipbook-container {
        height: auto;
        background-color: #fff;
    }
}
