/* Raspiši Pobedu - Dark Theme */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0D0D0D;
    --bg-card: #111111;
    --bg-elevated: #1A1A1A;
    --red: #C62828;
    --red-light: #E53935;
    --red-glow: rgba(198, 40, 40, 0.4);
    --white: #FFFFFF;
    --gray: #666666;
    --gray-light: #999999;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-lg: 16px;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--white);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 24px;
}

.logo img {
    height: 40px;
    width: auto;
}

/* Main */
main {
    flex: 1;
}

/* Info Notice - subtle hint for people who haven't signed */
.info-notice {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.info-notice:hover {
    opacity: 1;
}

.info-notice.hidden {
    display: none;
}

.info-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-icon {
    flex-shrink: 0;
    color: var(--gray);
}

.info-icon svg {
    width: 16px;
    height: 16px;
}

.info-text {
    flex: 1;
}

.info-text p {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
    line-height: 1.4;
    display: inline;
}

.info-text p strong {
    color: var(--gray-light);
    font-weight: 500;
}

.info-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-light);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
    margin-left: 4px;
}

.info-link:hover {
    color: var(--white);
}

.info-dismiss {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    padding: 0;
}

.info-dismiss:hover {
    color: var(--gray-light);
}

/* Success Banner - Always visible */
.success-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.12), rgba(198, 40, 40, 0.04));
    border: 1px solid rgba(198, 40, 40, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.success-check {
    flex-shrink: 0;
    color: var(--red);
}

.success-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--white);
}

.success-text p {
    font-size: 0.9rem;
    color: var(--gray-light);
    line-height: 1.5;
}

/* Gender Toggle */
.gender-toggle-section {
    margin-bottom: 20px;
}

.gender-toggle {
    display: inline-flex;
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid #222;
    border-radius: var(--radius);
    padding: 4px;
    width: auto;
}

.gender-option {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--gray);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
    border-radius: calc(var(--radius) - 4px);
}

.gender-option:hover {
    color: var(--gray-light);
}

.gender-option.active {
    color: var(--white);
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--red);
    border-radius: calc(var(--radius) - 4px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.gender-toggle[data-gender="female"] .toggle-slider {
    transform: translateX(100%);
}

.gender-toggle-section {
    text-align: left;
    margin-bottom: 16px;
}

/* Upload Section */
.upload-section {
    text-align: center;
    margin-bottom: 24px;
}

.upload-section.hidden {
    display: none;
}

.upload-zone {
    background: var(--bg-secondary);
    border: 1px solid #222;
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover {
    border-color: var(--red);
    background: rgba(198, 40, 40, 0.03);
}

.upload-zone.drag-over {
    border-color: var(--red);
    background: rgba(198, 40, 40, 0.08);
}

.upload-icon {
    color: var(--red);
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.upload-subtext {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Crop Section */
.crop-section {
    display: none;
    text-align: center;
}

.crop-section.visible {
    display: block;
}

.crop-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.crop-subtitle {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 20px;
}

.crop-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 350px;
    margin: 0 auto 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    /* Prevent iOS callout */
    -webkit-touch-callout: none;
}

.crop-container:active {
    cursor: grabbing;
}

.crop-image-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    will-change: transform;
}

.crop-image-wrapper img {
    display: block;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.crop-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 88%;
    height: 88%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.crop-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 16px;
}

.crop-hint svg {
    opacity: 0.6;
}

.zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 10px;
}

.zoom-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-elevated);
    color: var(--gray-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    /* Better touch target */
    -webkit-tap-highlight-color: transparent;
}

.zoom-btn:hover {
    background: var(--red);
    color: var(--white);
}

.zoom-btn:active {
    transform: scale(0.92);
    background: var(--red);
    color: var(--white);
}

.zoom-slider {
    flex: 1;
    max-width: 180px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-elevated);
    border-radius: 3px;
    outline: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--red);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
    /* Better touch target */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.zoom-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

.zoom-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--red);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.crop-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--gray-light);
    padding: 16px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid #333;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
    border-color: var(--gray);
    color: var(--white);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-confirm {
    background: var(--red);
    color: var(--white);
    padding: 16px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-confirm:hover {
    background: var(--red-light);
}

.btn-confirm:active {
    transform: scale(0.98);
}

/* Preview Section */
.preview-section {
    display: none;
    text-align: center;
}

.preview-section.visible {
    display: block;
}

.preview-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    display: inline-block;
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--bg-elevated);
    color: var(--white);
    flex: 1;
    border: 1px solid #222;
}

.btn-primary:hover {
    background: var(--red);
    border-color: var(--red);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: transparent;
}

.btn-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
}

.btn-tiktok:hover {
    background: #000000;
    border-color: #69C9D0;
    box-shadow: 0 0 0 1px #EE1D52, 0 0 0 2px #69C9D0;
}

.btn-text {
    background: transparent;
    color: var(--gray-light);
    padding: 10px 16px;
    font-size: 0.85rem;
}

.btn-text:hover {
    color: var(--white);
}

.btn-text svg {
    opacity: 0.7;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Download Section */
.download-section {
    margin-bottom: 32px;
}

.download-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    text-align: center;
}

.download-buttons {
    display: flex;
    gap: 10px;
}

.download-buttons-row2 {
    margin-top: 10px;
}

.download-buttons .btn span {
    font-size: 0.8rem;
}

/* Instructions */
.instructions {
    margin-top: 24px;
}

.instructions-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    text-align: center;
}

.instruction-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.instruction-card {
    background: var(--bg-secondary);
    border: 1px solid #1a1a1a;
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
}

.instruction-card .platform-icon {
    color: var(--gray-light);
    margin: 0 auto 8px;
    display: block;
}

.instruction-card p {
    font-size: 0.75rem;
    color: var(--gray);
    line-height: 1.4;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 32px;
    margin-top: auto;
}

/* Signing Locations CTA */
.signing-cta {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.15), rgba(198, 40, 40, 0.05));
    border: 1px solid rgba(198, 40, 40, 0.4);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
}

.signing-cta-icon {
    color: var(--red);
    margin-bottom: 12px;
}

.signing-cta-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.signing-cta-subtitle {
    font-size: 0.9rem;
    color: var(--gray-light);
    line-height: 1.5;
    margin-bottom: 16px;
}

.signing-cta-subtitle strong {
    color: var(--white);
}

.signing-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    padding: 14px 24px;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.signing-cta-button:hover {
    background: var(--red-light);
    transform: translateY(-1px);
}

.signing-cta-button svg {
    opacity: 0.9;
}

/* Legacy share link section (keeping for reference) */
.share-link-section {
    background: var(--bg-secondary);
    border: 1px solid #222;
    border-radius: var(--radius);
    padding: 16px 20px;
}

.share-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray-light);
    margin-bottom: 8px;
}

.share-label svg {
    color: var(--red);
}

.share-link {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    transition: color 0.15s ease;
}

.share-link:hover {
    color: var(--red);
}

/* Responsive */
@media (min-width: 480px) {
    .download-buttons .btn {
        flex-direction: column;
        padding: 16px 12px;
        gap: 6px;
    }
    
    .btn-icon {
        width: 24px;
        height: 24px;
    }
}

@media (min-width: 640px) {
    .container {
        padding: 32px 24px;
    }
    
    .success-banner {
        padding: 24px;
    }
}

/* iOS Save Modal */
.ios-save-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-save-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.ios-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    color: var(--gray-light);
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ios-modal-close:hover {
    background: var(--red);
    color: var(--white);
}

.ios-save-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 8px;
}

.ios-save-instruction {
    color: var(--gray-light);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ios-save-instruction strong {
    color: var(--red);
}

.ios-save-image-container {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
}

.ios-save-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    /* Prevent iOS from trying to zoom/drag the image */
    -webkit-touch-callout: default !important;
    -webkit-user-select: none;
    user-select: none;
}

.ios-save-hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin: 0;
}
