/**
 * Lantrix RemindMe
 * 
 * Custom CSS Styles
 * 
 * File: /assets/css/style.css
 */

:root {
    --primary-color: #3a86ff;
    --primary-dark: #2a75e8;
    --secondary-color: #8338ec;
    --accent-color: #ff006e;
    --warning-color: #ffbe0b;
    --success-color: #38b000;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
}

/* General Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

.footer {
    margin-top: auto;
}

/* Brand/Logo Styles */
.navbar-brand .logo-text {
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.25rem;
}

/* Card Styles */
.card {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Navigation Styling */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.navbar .nav-link.active {
    color: var(--primary-color);
}

.navbar .nav-link:hover {
    color: var(--primary-dark);
}

/* Sidebar Styling */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Active item hover state */
.list-group-item.active:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.list-group-item:first-child {
    border-top: none;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.list-group-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Button Styling */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    text-transform: none;
    box-shadow: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Status Colors */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-accent, .bg-danger {
    background-color: var(--accent-color) !important;
}

.border-warning {
    border-color: var(--warning-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

/* Form Controls */
.form-control {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(58, 134, 255, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
}

/* Camera Preview */
.camera-preview {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    margin-bottom: 1rem;
}

/* Image Preview */
#previewImg {
    max-height: 300px;
    object-fit: contain;
}

/* Enhanced Voucher Card Styling */
.voucher-item {
    margin-bottom: 2rem;
    position: relative;
    min-height: 220px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.voucher-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

.voucher-img-container {
    width: 90px;
    height: 90px;
    margin-right: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.voucher-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.voucher-info {
    flex-grow: 1;
    min-width: 0; /* Allows text to truncate */
    padding: 0.25rem 0;
}

.voucher-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Improved Status Badge */
.status-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 0.5rem;
    border-radius: 0 0.5rem 0 0.5rem;
    font-weight: 500;
}

.status-badge .badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Code Container */
.code-container {
    margin: 0.75rem 0;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.code-value {
    font-family: 'Courier New', monospace;
    background-color: white;
    font-size: 0.9rem;
}

/* Improved Voucher Actions */
.voucher-actions {
    margin-top: auto;
    padding-top: 0.75rem;
}

.voucher-actions .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
}

.action-buttons .btn i {
    font-size: 0.9rem;
}

/* Dashboard Stats */
.stats-card {
    color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    height: 100%;
}

.stats-card .card-title {
    opacity: 0.9;
    font-size: 1rem;
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Animation for alerts */
.alert {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Section Styling */
.dashboard-section {
    position: relative;
    margin-bottom: 2.5rem;
}

.section-header {
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    bottom: -0.75rem;
    left: 0;
}

.section-content {
    position: relative;
}

/* Recently Added list styling */
.section-content .list-group-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Quick Tips section styling */
.dashboard-section:last-child {
    margin-bottom: 0;
}

.dashboard-section:last-child .card {
    border-left: 3px solid var(--warning-color);
}

/* Stats Cards Section */
.stats-card {
    transition: transform 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
}

/* Expiring Soon voucher cards on dashboard */
.row-cols-md-2.g-4 .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.row-cols-md-2.g-4 .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

/* Recently Added list items */
.list-group-item-action {
    transition: background-color 0.2s ease;
}

.list-group-item-action:hover {
    background-color: rgba(58, 134, 255, 0.05);
}

/* Make voucher card border more subtle but visible */
.card.border-warning.border-4 {
    border-width: 3px !important;
}

/* CSS for Voucher Image Modal */
.voucher-img-preview {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

.voucher-img-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Modal image styling */
.voucher-img-modal {
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0.375rem;
}

/* Modal styling */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #f8f9fa;
}

.modal-body {
    padding: 1.5rem;
}

/* Animation for modal */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

/* Image container with delete button */
.image-container {
    position: relative;
    padding: 0;
    overflow: hidden;
    text-align: center;
}

.delete-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 0, 0, 0.7);
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.image-container:hover .delete-image-btn {
    opacity: 1;
}

.delete-image-btn:hover {
    background-color: rgba(220, 53, 69, 1);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .navbar .nav-link {
        padding: 0.375rem 0.75rem;
    }
    
    .sticky-lg-top {
        position: static;
    }
    
    .card-footer {
        padding: 0.75rem 1.25rem;
    }
}

/* Responsive adjustments for voucher cards */
@media (max-width: 767px) {
    .voucher-info {
        padding-right: 0;
    }
    
    .voucher-actions .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        margin-top: 0.75rem;
        align-self: flex-end;
    }
    
    .voucher-img-container {
        width: 70px;
        height: 70px;
        margin-right: 1rem;
    }
    
    .list-group-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .list-group-item .text-end {
        text-align: left !important;
        margin-top: 0.5rem;
    }
    
    .d-flex.align-items-center.flex-wrap {
        gap: 0.5rem;
    }
    
    .section-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-title:after {
        width: 40px;
        height: 2px;
        bottom: -0.5rem;
    }
    
    .dashboard-section {
        margin-bottom: 2rem;
    }
    
    .voucher-img-modal {
        max-height: 60vh;
    }
    
    .voucher-img-preview {
        max-height: 150px;
    }
    
    .delete-image-btn {
        opacity: 1; /* Always visible on mobile */
    }
}

/* Print Styles */
@media print {
    .navbar, .sidebar, .footer, .btn, .form-control {
        display: none !important;
    }
    
    body {
        background-color: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .main-content {
        width: 100%;
    }
}