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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: #f0f2f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
}

/* Claim box styles */
.claim-box {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 30px;
    font-size: 2em;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Timer styles */
#timer-section {
    text-align: center;
    margin-bottom: 30px;
}

.timer {
    font-size: 2em;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timer span {
    display: inline-block;
    padding: 10px;
}

.timer-warning {
    color: #e74c3c;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-color: #1a73e8;
    outline: none;
}

button {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: background 0.3s;
}

button:hover {
    background: #1557b0;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Result styles */
.success-message {
    text-align: center;
}

.gift-code {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.gift-code input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 18px;
    font-family: monospace;
    text-align: center;
    background: #f8f9fa;
}

.gift-code button {
    width: auto;
}

.note {
    color: #666;
    font-size: 14px;
    margin-top: 20px;
}

/* Alert styles */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert.error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #166534;
}

/* Scratch Card styles */
.scratch-container {
    position: relative;
    width: 300px;
    height: 150px;
    margin: 20px auto;
    display: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.scratch-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
    z-index: 1;
    padding: 20px;
    text-align: center;
    word-break: break-all;
}

.scratch-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

#codeDisplay {
    text-align: center;
    font-size: 24px;
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin: 10px 0;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Instructions */
.scratch-instructions {
    text-align: center;
    color: #666;
    margin: 10px 0;
    font-size: 14px;
    display: none;
}

.scratch-container.active .scratch-instructions {
    display: block;
}

/* Success Animation */
.success-animation {
    animation: successPulse 1s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        margin: 20px auto;
        padding: 10px;
    }
    
    .claim-box {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .timer {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .scratch-container {
        width: 280px;
        height: 140px;
    }
    
    .scratch-content {
        font-size: 20px;
    }
    
    #codeDisplay {
        font-size: 20px;
        padding: 15px;
    }
}
