/* Main CSS for LegalNotice v2 */

/* Root Variables */
:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

#walletAddress {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Buttons */
.btn {
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Alert Container */
#alertContainer {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

#alertContainer .alert {
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Processing Modal */
#processingModal .modal-content {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Receipt Document Styles */
.receipt-document {
    background: white;
    min-height: 600px;
}

.receipt-document h2 {
    color: var(--dark-color);
}

.receipt-document h4 {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: bold;
    margin-top: 20px;
}

.receipt-document table {
    border-collapse: collapse;
}

.receipt-document code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Case Table */
#casesTableBody tr {
    transition: background-color 0.2s;
}

#casesTableBody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Status Badges */
.badge {
    padding: 0.35em 0.65em;
    font-weight: normal;
}

/* File Upload Area */
input[type="file"] {
    cursor: pointer;
}

input[type="file"]:hover {
    background-color: var(--light-color);
}

/* Energy Progress Bar */
.progress {
    height: 25px;
    background-color: #e9ecef;
}

.progress-bar {
    font-size: 12px;
    line-height: 25px;
}

/* Admin Panel */
#adminPage .card-header {
    background-color: var(--primary-color);
    color: white;
}

#adminPage .text-center h3 {
    color: var(--primary-color);
    font-weight: bold;
}

/* Notice Viewer Modal */
#noticeViewerModal .modal-body img {
    max-height: 500px;
    object-fit: contain;
    border: 1px solid #dee2e6;
    padding: 10px;
    background: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    #alertContainer {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .receipt-document {
        padding: 10px !important;
        font-size: 12px !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    #alertContainer,
    .modal-footer,
    .btn {
        display: none !important;
    }
    
    .receipt-document {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    body {
        background: white !important;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,123,255,.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success-color);
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.success-checkmark .check-icon::before,
.success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: white;
    transform: rotate(-45deg);
}

.success-checkmark .check-icon .icon-line {
    height: 5px;
    background-color: var(--success-color);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.success-checkmark .check-icon .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 46px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}