/* =========================================
   FileShare - Serverless File Sharing
   Professional Modern CSS
   ========================================= */

:root {
    --primary-blue: #0468BF;
    --dark-blue: #0339A6;
    --light-blue: #79ACD9;
    --red: #D91A1A;
    --light-gray: #F2F2F2;
    
    --primary: #0468BF;
    --primary-dark: #0339A6;
    --primary-light: #79ACD9;
    --secondary: #0339A6;
    --success: #0468BF;
    --warning: #D91A1A;
    --error: #D91A1A;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --text: #79ACD9;
    --text-muted: #79ACD9;
    --text-light: #79ACD9;
    --border: #79ACD9;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

/* Grid Background */
.grid-wrapper {
    min-height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffffff;
    z-index: 0;
}

.grid-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    background-image: linear-gradient(to right, #79ACD9 1px, transparent 1px),
        linear-gradient(to bottom, #79ACD9 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.4;
    -webkit-mask-image: radial-gradient(
        ellipse 70% 60% at 50% 0%,
        #000 60%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 70% 60% at 50% 0%,
        #000 60%,
        transparent 100%
    );
}

@media (max-width: 768px) {
    .grid-background {
        background-size: 40px 40px;
        opacity: 0.25;
    }
}

@media (max-width: 480px) {
    .grid-background {
        background-size: 50px 50px;
        opacity: 0.15;
    }
}

/* Layout */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
    z-index: 1;
    justify-content: center;
    align-items: center;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-top {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
}

.nav-link {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
}

.nav-link:hover {
    background: var(--primary-dark);
    transform: translateX(-2px);
}

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

@media (max-width: 480px) {
    .nav-top {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        width: auto;
    }
    
    .nav-link {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #0339A6 0%, #0468BF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(4, 104, 191, 0.4)) drop-shadow(0 0 40px rgba(3, 57, 166, 0.2));
}

.subtitle {
    font-size: 1.125rem;
    color: #0468BF;
    max-width: 500px;
    margin: 0 auto;
    font-weight: 500;
    text-shadow: 0 0 15px rgba(4, 104, 191, 0.3), 0 0 30px rgba(121, 172, 217, 0.2);
}

/* Upload Container */
.upload-container {
    width: 100%;
    max-width: 500px;
}

.upload-zone {
    background: #ffffff !important;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.upload-zone:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(4, 104, 191, 0.05) 0%, rgba(121, 172, 217, 0.05) 100%);
    transform: scale(1.02);
}

.upload-zone.has-file {
    cursor: default;
    border-style: solid;
    border-color: var(--border);
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
    padding: 1.5rem 1.5rem;
}

@media (max-width: 480px) {
    .upload-zone {
        padding: 1.5rem 1rem;
    }
    
    .upload-zone.has-file {
        padding: 1rem;
    }
}

/* Ensure the upload SVG icon is visible on white background */
.upload-icon svg {
    width: 30%;
    height: 30%;
    fill: #000000 !important;
}

.upload-icon {
    color: #000000;
    margin-bottom: 1rem;
}

.upload-content {
    text-align: center;
    width: 100%;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.25rem;
}

.upload-subtext {
    color: #000000;
    font-size: 0.95rem;
}

.upload-link {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

.upload-link:hover {
    text-decoration: underline;
}

.upload-limits {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    color: #000000;
    font-size: 0.9rem;
}

.limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    margin-top: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.file-preview:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.files-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--error);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    min-height: 44px;
    min-width: 44px;
}

.btn-remove:hover {
    background: #c41e1e;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .file-preview {
        padding: 0.9rem 1rem;
        gap: 0.75rem;
    }
    
    .file-icon {
        font-size: 2rem;
    }
    
    .file-name {
        font-size: 0.9rem;
    }
    
    .file-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .file-preview {
        padding: 0.8rem;
        gap: 0.6rem;
        margin-top: 0.5rem;
    }
    
    .file-icon {
        font-size: 1.8rem;
    }
    
    .file-name {
        font-size: 0.85rem;
    }
    
    .file-meta {
        font-size: 0.7rem;
    }
    
    .btn-remove {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

.btn-remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--error);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    min-height: 44px;
    min-width: 44px;
}

.btn-remove:hover {
    background: #c41e1e;
    transform: scale(1.1);
}

/* Progress */
.progress-container {
    margin-top: 1.5rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Buttons */
.actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
}

.btn:hover {
    transform: translateY(-1px);
}

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

@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

#cancelBtn {
    background: var(--error);
    color: white;
    border: 1px solid var(--error);
}

#cancelBtn:hover {
    background: #c41e1e;
    border-color: #c41e1e;
    box-shadow: 0 6px 20px 0 rgba(217, 26, 26, 0.4);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-copy {
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

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

.btn-icon {
    font-size: 1.1rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
    width: 100%;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Share Page */
.success-container,
.download-container,
.empty-container,
.error-container,
.loading-container {
    text-align: center;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

#errorSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.error-container .btn,
.error-container .contactButton,
#errorSection .btn,
#errorSection .contactButton {
    margin: 0 auto;
}

.success-badge,
.download-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: 50%;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.download-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.success-badge-large {
    width: 100px;
    height: 100px;
}

/* File Card */
.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 1.5rem 0;
    text-align: left;
}

.file-card-large {
    padding: 1.5rem 2rem;
}

.file-card-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.file-card-info {
    flex: 1;
    min-width: 0;
}

.file-card-name {
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.file-card-size {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Share Section */
.share-section {
    margin: 2rem 0;
    text-align: left;
}

.share-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-input-group {
    display: flex;
    gap: 0.5rem;
}

.share-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
}

.share-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.share-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Choice Grid */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Rotating Border Button */
.rotating-button {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 280px;
    cursor: pointer;
    border: 3px solid #E8F4FC;
    background: linear-gradient(145deg, #ffffff 0%, #F8FBFF 100%);
    padding: 0;
    font-family: inherit;
    transition: all 0.3s ease;
    border-radius: 1.5em;
    box-shadow: rgba(3, 57, 166, 0.25) 0px 30px 50px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 26px -18px inset, 0 8px 32px rgba(3, 57, 166, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    min-height: 280px;
}

.rotating-button:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: rgba(3, 57, 166, 0.3) 0px 30px 60px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 26px -18px inset, 0 16px 48px rgba(3, 57, 166, 0.2), 0 4px 16px rgba(0, 0, 0, 0.1);
}

@media (hover: none) and (pointer: coarse) {
    .rotating-button:hover {
        transform: none;
    }
    
    .rotating-button:active {
        transform: scale(0.98);
    }
}

.rotating-button svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

/* Upload button - Blue theme */
.rotating-button:first-child .border {
    width: 100%;
    height: 100%;
    stroke: #0468BF;
    stroke-width: 5px;
    fill: none;
    rx: 1.5em;
    ry: 1.5em;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 30px rgba(4, 104, 191, 0.8)) drop-shadow(0 0 50px rgba(4, 104, 191, 0.5));
}

.rotating-button:first-child:hover .border {
    stroke-width: 6px;
    filter: drop-shadow(0 0 40px rgba(4, 104, 191, 0.9)) drop-shadow(0 0 60px rgba(4, 104, 191, 0.6));
    stroke: #0339A6;
}

/* Download button - Green theme */
.rotating-button:last-child .border {
    width: 100%;
    height: 100%;
    stroke: #22c55e;
    stroke-width: 5px;
    fill: none;
    rx: 1.5em;
    ry: 1.5em;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 30px rgba(34, 197, 94, 0.8)) drop-shadow(0 0 50px rgba(34, 197, 94, 0.5));
}

.rotating-button:last-child:hover .border {
    stroke-width: 6px;
    filter: drop-shadow(0 0 40px rgba(34, 197, 94, 0.9)) drop-shadow(0 0 60px rgba(34, 197, 94, 0.6));
    stroke: #22c55e;
}

@keyframes stroke-animation {
    0% {
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes stroke-animation-reverse {
    0% {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: 100;
    }
}

.rotating-button .loading {
    display: none;
}

.rotating-button:focus .loading {
    transition: stroke 0.5s 7.5s, stroke-dasharray 8s 0.5s ease-out;
    stroke: var(--success);
    stroke-dasharray: 100 0;
}

.rotating-button .done {
    display: none;
}

.rotating-button:focus .done-cloud {
    transition: stroke-dasharray 0.75s 8.5s ease-out;
    stroke-dasharray: 100 0;
}

.rotating-button:focus .done-check {
    transition: stroke-dasharray 0.5s 9.2s ease-out;
    stroke: var(--success);
    stroke-dasharray: 100 0;
}

.button-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    z-index: 10;
}

.choice-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(3, 57, 166, 0.2));
}

.choice-icon img {
    max-width: 100%;
    height: auto;
    display: block;
}

.choice-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0339A6;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Upload button title */
.rotating-button:first-child .choice-title {
    color: #0468BF;
}

/* Download button title */
.rotating-button:last-child .choice-title {
    color: #22c55e;
}

.choice-desc {
    font-size: 0.875rem;
    color: #0468BF;
    margin: 0;
    font-weight: 500;
}

/* Back Button */
.btn-back {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(-4px);
}

.btn-back:active {
    transform: translateX(-2px);
}

/* Share Actions */
.share-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

/* Info Box */
.info-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(121, 172, 217, 0.15) 0%, rgba(4, 104, 191, 0.1) 100%);
    border: 2px solid #79ACD9;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-top: 1.5rem;
    color: #0339A6;
    box-shadow: 0 8px 32px rgba(3, 57, 166, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.info-box p {
    color: #0339A6;
    margin: 0;
    line-height: 1.4;
    font-size: 0.85rem;
}

.info-box strong {
    color: #0468BF;
    font-weight: 800;
    display: block;
    margin-bottom: 0.5rem;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-content {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.info-content strong {
    color: var(--text);
}

/* Security Note */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.security-icon {
    font-size: 1.1rem;
}

/* Empty State */
.empty-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.paste-section {
    margin: 2rem 0;
    text-align: left;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Loading */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--text);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

.toast-icon {
    font-size: 1.1rem;
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --radius: 10px;
        --radius-lg: 14px;
        --radius-xl: 20px;
    }
    
    html {
        font-size: 15px;
    }
    
    .header {
        padding: 1rem;
    }
    
    .main {
        padding: 2rem 1rem;
        max-width: 100%;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 3rem;
    }
    
    .feature {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        padding: 1rem;
        background: var(--bg-card);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
    
    .feature-icon {
        font-size: 2rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .choice-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }

    .share-actions {
        flex-direction: column;
    }
    
    .upload-limits {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rotating-button {
        max-width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-height: 280px;
    }
    
    .actions {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .logo-text {
        display: none;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
    
    .main {
        padding: 1.5rem 0.75rem;
    }
    
    .title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
        max-width: 100%;
    }
    
    .hero {
        margin-bottom: 1.5rem;
    }
    
    .upload-zone {
        padding: 1.5rem 1rem;
    }
    
    .btn-lg {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
        min-height: 44px;
    }
    
    .choice-grid {
        margin: 2rem 0;
    }
    
    .rotating-button {
        max-width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-height: 240px;
    }
    
    .button-content {
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .choice-title {
        font-size: 1.1rem;
    }
    
    .choice-desc {
        font-size: 0.75rem;
    }
    
    .choice-icon {
        font-size: 2.5rem;
    }
    
    .upload-text {
        font-size: 1.1rem;
    }
    
    .upload-subtext {
        font-size: 0.9rem;
    }
    
    .form {
        width: 100%;
    }
    
    .input-fields {
        gap: 0.5rem;
    }
    
    .code-digit {
        width: 100%;
        max-width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

/* Code Display Styles */
.code-display {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.code-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.code-box {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.5rem;
    color: white;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary);
    margin-bottom: 1rem;
    user-select: all;
}

.btn-copy {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}

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

/* Code Input Styles */
.code-input-container {
    max-width: 400px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.code-input-wrapper {
    margin-bottom: 1rem;
}

.code-input {
    width: 100%;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Monaco', 'Consolas', monospace;
    text-align: center;
    letter-spacing: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text);
    text-transform: uppercase;
    transition: var(--transition);
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.code-input::placeholder {
    color: var(--text-light);
    letter-spacing: 0.3rem;
}

/* Download Badge */
.download-badge {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Success Badge */
.success-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: 50%;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

/* Error Icon */
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-box strong {
    color: var(--text);
}

/* Security Note */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Share Actions */
.share-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

/* Text Button */
.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    margin-top: 1rem;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Loading Spinner */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

.loading-text {
    color: var(--text-muted);
    text-align: center;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --bg-card: #1e293b;
        --text: #f1f5f9;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --border: #334155;
    }
    
    .header {
        background: rgba(30, 41, 59, 0.9);
    }
    
    .upload-zone:hover {
        border-color: var(--primary);
    }
    
    .code-input {
        background: var(--bg-card);
        color: var(--text);
    }
    
    .qr-container {
        background: white;
    }
}

/* Steps Container */
.steps-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.steps-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    background: rgba(245, 245, 245, 0.8);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 120px;
}

.step-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(4, 104, 191, 0.6)) drop-shadow(0 0 25px rgba(4, 104, 191, 0.3));
}

.step-title {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    letter-spacing: 0.5px;
}

/* Page Icon for Download/Upload pages */
.page-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.6)) drop-shadow(0 0 40px rgba(34, 197, 94, 0.3));
}

/* Blue page icon for upload page */
.page-icon-blue img {
    filter: drop-shadow(0 0 20px rgba(4, 104, 191, 0.6)) drop-shadow(0 0 40px rgba(4, 104, 191, 0.3));
}

/* Green button styles for download page */
.btn-green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-green:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    transform: translateY(-2px);
}

.btn-green-outline {
    background: transparent;
    border: 2px solid #22c55e;
    color: #22c55e;
}

.btn-green-outline:hover {
    background: rgba(34, 197, 94, 0.1);
}

/* Green progress bar */
.progress-fill-green {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

/* Form Input Fields for 6-digit code */
.form .input-fields {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1.5rem 0;
}

.form .input-fields input {
    height: 2.5em;
    width: 2.5em;
    outline: none;
    text-align: center;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1.5rem;
    color: #0339A6;
    border-radius: 8px;
    border: 2.5px solid #79ACD9;
    background-color: white;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.form .input-fields input:focus {
    border: 2.5px solid #0468BF;
    box-shadow: 0 0 0 4px rgba(4, 104, 191, 0.2), inset 0 0 10px rgba(4, 104, 191, 0.1);
    transform: scale(1.08);
    transition: all 0.3s ease;
}

.form .input-fields input::placeholder {
    color: #D1D5DB;
}

/* Contact Button Style */
.contactButton {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-family: inherit;
    padding: 0.45em;
    padding-left: 1em;
    font-size: 17px;
    font-weight: 500;
    border-radius: 0.9em;
    border: none;
    cursor: pointer;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    box-shadow: inset 0 0 1.6em -0.6em rgba(22, 163, 74, 0.8);
    overflow: hidden;
    position: relative;
    height: 2.8em;
    padding-right: 3em;
    transition: all 0.3s ease;
}

.iconButton {
    margin-left: 1em;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.2em;
    width: 2.2em;
    border-radius: 0.7em;
    box-shadow: 0.1em 0.1em 0.6em 0.2em rgba(34, 197, 94, 0.5);
    right: 0.3em;
    transition: all 0.3s;
}

.contactButton:hover {
    transform: translate(-0.05em, -0.05em);
    box-shadow: 0.15em 0.15em rgba(22, 163, 74, 0.6);
}

.contactButton:active {
    transform: translate(0.05em, 0.05em);
    box-shadow: 0.05em 0.05em rgba(22, 163, 74, 0.6);
}

/* Social Links */
.social-links {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 50;
}

.social-links a {
    text-decoration: none;
    display: flex;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-btn {
    cursor: pointer;
    height: 50px;
    width: 50px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #333;
    border-radius: 10px;
    box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.1);
    background: white;
    transition: all 0.3s ease;
    justify-content: center;
    border: none;
    display: flex;
    align-items: center;
}

.social-btn svg {
    height: 24px;
    width: 24px;
}

.social-btn span {
    width: 0px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
    margin-left: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.social-btn:hover {
    width: 150px;
    border-radius: 5px;
    transform: translateY(-2px);
    box-shadow: 0px 15px 20px rgba(0, 0, 0, 0.15);
}

.social-btn:hover span {
    padding: 2px;
    width: 80px;
}

#linkedin svg {
    fill: #0e76a8;
}

#github svg {
    fill: #333;
}

@media (max-width: 768px) {
    .social-links {
        bottom: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }
    
    .social-btn {
        height: 45px;
        width: 45px;
    }
    
    .social-btn svg {
        height: 20px;
        width: 20px;
    }
    
    .social-btn:hover {
        width: 130px;
    }
    
    .social-btn:hover span {
        width: 70px;
    }
}

@media (max-width: 480px) {
    .social-links {
        bottom: 0.75rem;
        right: 0.75rem;
        gap: 0.4rem;
    }
    
    .social-btn {
        height: 40px;
        width: 40px;
    }
    
    .social-btn svg {
        height: 18px;
        width: 18px;
    }
    
    .social-btn span {
        font-size: 0.8rem;
    }
    
    .social-btn:hover {
        width: 110px;
    }
    
    .social-btn:hover span {
        width: 60px;
    }
}
