/* Crow Download Creator - Frontend Styles */
/* Red & Black Theme with Professional Animations */

:root {
    --cdc-primary: #ff0000;
    --cdc-primary-dark: #cc0000;
    --cdc-primary-light: #ff3333;
    --cdc-secondary: #000000;
    --cdc-dark: #0a0a0a;
    --cdc-dark-light: #111111;
    --cdc-dark-lighter: #1a1a1a;
    --cdc-text: #ffffff;
    --cdc-text-muted: #aaaaaa;
    --cdc-border: #222222;
    --cdc-success: #00ff88;
    --cdc-warning: #ffaa00;
    --cdc-glow: 0 0 20px rgba(255, 0, 0, 0.3);
    --cdc-glow-strong: 0 0 30px rgba(255, 0, 0, 0.5);
}

/* Main Download Card */
.cdc-download-card {
    background: linear-gradient(135deg, var(--cdc-dark-light) 0%, var(--cdc-dark-lighter) 100%);
    border: 2px solid var(--cdc-border);
    border-radius: 20px;
    padding: 35px;
    max-width: 500px;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardAppear 0.8s ease forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cdc-download-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(255, 0, 0, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 0, 0, 0.05) 0%, transparent 50%);
    animation: backgroundRotate 20s linear infinite;
    pointer-events: none;
}

@keyframes backgroundRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cdc-download-card:hover {
    border-color: var(--cdc-primary);
    box-shadow: var(--cdc-glow-strong);
    transform: translateY(-5px);
}

/* Card Header */
.cdc-card-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.cdc-card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--cdc-primary-dark) 0%, var(--cdc-primary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2.5em;
    color: var(--cdc-text);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 50px rgba(255, 0, 0, 0.6);
        transform: scale(1.05);
    }
}

.cdc-card-title {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--cdc-text);
    margin: 0 0 5px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.cdc-card-subtitle {
    color: var(--cdc-text-muted);
    font-size: 0.95em;
}

/* File Info Section */
.cdc-file-info {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cdc-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.cdc-file-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cdc-file-info-item:last-child {
    border-bottom: none;
}

.cdc-file-info-item i {
    width: 35px;
    height: 35px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cdc-primary);
    font-size: 1em;
}

.cdc-file-info-item .label {
    color: var(--cdc-text-muted);
    font-size: 0.9em;
    min-width: 80px;
}

.cdc-file-info-item .value {
    color: var(--cdc-text);
    font-weight: 500;
    flex: 1;
}

/* Thumbnail */
.cdc-thumbnail {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid var(--cdc-border);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.cdc-thumbnail:hover {
    border-color: var(--cdc-primary);
    box-shadow: var(--cdc-glow);
    transform: scale(1.02);
}

/* Download Button */
.cdc-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--cdc-primary-dark) 0%, var(--cdc-primary) 50%, var(--cdc-primary-light) 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 12px;
    color: var(--cdc-text);
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientShift 3s ease infinite;
    text-decoration: none;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.cdc-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.cdc-download-btn:hover::before {
    left: 100%;
}

.cdc-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.4);
}

.cdc-download-btn:active {
    transform: translateY(-1px);
}

.cdc-download-btn i {
    font-size: 1.3em;
    animation: downloadBounce 1.5s ease-in-out infinite;
}

@keyframes downloadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* QR Code Section */
.cdc-qr-section {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--cdc-border);
    position: relative;
    z-index: 1;
}

.cdc-qr-section h4 {
    color: var(--cdc-text-muted);
    font-size: 0.9em;
    margin: 0 0 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cdc-qr-code {
    display: inline-block;
    padding: 15px;
    background: var(--cdc-text);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.cdc-qr-code:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 0, 0, 0.3);
}

.cdc-qr-code img {
    max-width: 150px;
    border-radius: 8px;
}

/* Password Form */
.cdc-password-form {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--cdc-border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.cdc-password-form h4 {
    color: var(--cdc-primary);
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdc-password-form input {
    width: 100%;
    padding: 14px 18px;
    background: var(--cdc-dark-lighter);
    border: 2px solid var(--cdc-border);
    border-radius: 10px;
    color: var(--cdc-text);
    font-size: 1em;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cdc-password-form input:focus {
    outline: none;
    border-color: var(--cdc-primary);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

/* Download List */
.cdc-download-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.cdc-download-list-item {
    background: linear-gradient(135deg, var(--cdc-dark-light) 0%, var(--cdc-dark-lighter) 100%);
    border: 2px solid var(--cdc-border);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: listItemAppear 0.6s ease forwards;
    opacity: 0;
}

.cdc-download-list-item:nth-child(1) { animation-delay: 0.1s; }
.cdc-download-list-item:nth-child(2) { animation-delay: 0.2s; }
.cdc-download-list-item:nth-child(3) { animation-delay: 0.3s; }
.cdc-download-list-item:nth-child(4) { animation-delay: 0.4s; }
.cdc-download-list-item:nth-child(5) { animation-delay: 0.5s; }

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

.cdc-download-list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--cdc-primary), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.cdc-download-list-item:hover {
    border-color: var(--cdc-primary);
    box-shadow: var(--cdc-glow);
    transform: translateY(-5px);
}

.cdc-download-list-item:hover::before {
    transform: scaleX(1);
}

.cdc-list-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cdc-list-item-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--cdc-primary-dark) 0%, var(--cdc-primary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--cdc-text);
    flex-shrink: 0;
}

.cdc-list-item-title {
    flex: 1;
}

.cdc-list-item-title h3 {
    color: var(--cdc-text);
    margin: 0 0 5px;
    font-size: 1.1em;
}

.cdc-list-item-title .meta {
    color: var(--cdc-text-muted);
    font-size: 0.85em;
}

.cdc-list-item-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cdc-list-item-stats .stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--cdc-text-muted);
    font-size: 0.85em;
}

.cdc-list-item-stats .stat i {
    color: var(--cdc-primary);
}

.cdc-list-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--cdc-primary-dark) 0%, var(--cdc-primary) 100%);
    border: none;
    border-radius: 8px;
    color: var(--cdc-text);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cdc-list-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.3);
}

/* Loading State */
.cdc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--cdc-text-muted);
}

.cdc-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--cdc-border);
    border-top-color: var(--cdc-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Error State */
.cdc-error {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid var(--cdc-primary);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    color: var(--cdc-text);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.cdc-error i {
    font-size: 3em;
    color: var(--cdc-primary);
    margin-bottom: 15px;
}

/* Success Animation */
.cdc-success-animation {
    animation: successPop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Count Badge */
.cdc-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 20px;
    color: var(--cdc-primary);
    font-size: 0.85em;
    font-weight: 500;
}

/* Expired Badge */
.cdc-expired-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255, 170, 0, 0.15);
    border: 1px solid rgba(255, 170, 0, 0.3);
    border-radius: 20px;
    color: var(--cdc-warning);
    font-size: 0.85em;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .cdc-download-card {
        padding: 25px;
        margin: 10px;
    }

    .cdc-card-title {
        font-size: 1.4em;
    }

    .cdc-download-list {
        grid-template-columns: 1fr;
    }

    .cdc-card-icon {
        width: 60px;
        height: 60px;
        font-size: 2em;
    }
}

/* Glow Effect for special elements */
.cdc-glow-text {
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.3);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.3); }
    to { text-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 0 0 40px rgba(255, 0, 0, 0.5); }
}

/* Particle effect container */
.cdc-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.cdc-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--cdc-primary);
    border-radius: 50%;
    opacity: 0.5;
    animation: particleFloat 10s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}
