/* Court Images Documenter - Tasteful Pink Theme */
:root {
    --primary-pink: #d63384;
    --light-pink: #f8d7da;
    --pale-pink: #fdf2f8;
    --dark-pink: #b02a5b;
    --accent-pink: #e91e63;
    --text-dark: #2d3748;
    --text-light: #4a5568;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--pale-pink) 0%, #ffffff 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.header h1 {
    color: var(--primary-pink);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(214, 51, 132, 0.1);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.control-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

select, input[type="file"] {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

select:focus, input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.1);
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink), var(--accent-pink));
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--light-pink);
    color: var(--dark-pink);
    border: 2px solid var(--primary-pink);
}

.btn-secondary:hover {
    background: var(--primary-pink);
    color: white;
}

.document-settings {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.document-settings h3 {
    color: var(--primary-pink);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.header-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-inputs input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--pale-pink);
}

.header-inputs input:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.1);
    background: white;
}

.preview-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.preview-section h3 {
    color: var(--primary-pink);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.page {
    width: 11in;
    height: 8.5in;
    background: white;
    margin: 20px auto;
    padding: 0.4in 0.75in 0.75in 0.75in;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    page-break-after: always;
}

.page-header {
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-pink);
    padding-bottom: 6px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header h2 {
    color: var(--primary-pink);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.page-header p {
    color: var(--text-light);
    font-size: 1rem;
    margin: 2px 0;
}

.images-grid {
    display: grid;
    gap: 15px;
    flex: 1;
    align-content: start;
    margin-bottom: 20px;
}

.images-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.images-grid.grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
}

.images-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.images-grid.grid-6 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.images-grid.grid-8 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: white;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    min-height: 0;
    height: 100%;
}

.image-item img {
    width: 100%;
    height: auto;
    max-height: calc(100% - 60px);
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    flex-shrink: 1;
}

.image-filename {
    font-size: 0.9rem;
    color: var(--text-dark);
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
    flex-shrink: 0;
    padding: 0 5px;
}



.page-number {
    position: absolute;
    bottom: 20px;
    right: 30px;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        min-width: auto;
    }
    
    .page {
        transform: scale(0.7);
        transform-origin: top center;
        margin: 10px auto;
    }
}

@media print {
    body {
        background: white;
    }
    
    .header, .document-settings, .preview-section h3 {
        display: none;
    }
    
    .page {
        margin: 0;
        box-shadow: none;
        border: none;
        page-break-after: always;
    }
}

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

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

/* Advertisement styles */
.advertisement {
    margin-top: 30px;
    text-align: center;
}

.ad-button {
    display: inline-block;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    max-width: 600px;
}

.ad-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd, #2968a3);
}

.ad-button strong {
    display: block;
    margin-top: 8px;
    font-size: 1.1rem;
    color: #fff3cd;
}

/* Drag and drop styles */
.drag-over {
    border-color: var(--primary-pink) !important;
    background: var(--pale-pink) !important;
}

.drag-over::after {
    content: "Drop images here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-pink);
    font-weight: bold;
    font-size: 1.2rem;
}
