/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Container */
.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.hide {
    opacity: 0;
    pointer-events: none;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.logo-icon {
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease;
}

.logo-icon img {
    animation: logoPulseUltraSmooth 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.3));
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
}

.progress-step.completed .step-circle {
    background: #2ed573;
    border-color: #2ed573;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
}

.progress-step span {
    font-size: 12px;
    white-space: nowrap;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.3);
    margin: 0 10px;
    margin-bottom: 28px;
}

/* Step Screens */
.step-screen {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.step-screen.active {
    display: block;
}

.step-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid #5C4E00;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1);
}

.step-card h2 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.step-description {
    margin-bottom: 30px;
}

.step-description p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.note {
    font-size: 14px;
    opacity: 0.8;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
}

.requirement-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.requirement-box p {
    font-weight: 500;
    margin-bottom: 10px;
}

.requirement-box ul {
    list-style: none;
    padding-left: 20px;
}

.requirement-box li {
    margin-bottom: 5px;
    position: relative;
}

.requirement-box li:before {
    content: "•";
    position: absolute;
    left: -15px;
}

/* Image Display */
.image-display {
    text-align: center;
    margin: 20px 0;
    cursor: pointer;
}

.random-image {
    max-width: 100%;
    border-radius: 15px;
    border: 2px solid #5C4E00;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.random-image:hover {
    transform: scale(1.02);
}

/* Buttons */
.primary-button, .secondary-button {
    width: 100%;
    padding: 15px 30px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Kanit', sans-serif;
}

.primary-button {
    background: linear-gradient(45deg, #5C4E00 0%, #0D0A00 100%);
    color: #FFEABD;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    font-weight: 700;
    animation: btnJump 1.1s cubic-bezier(0.34,1.56,0.64,1) infinite;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.secondary-button {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    animation: btnJump 1.1s cubic-bezier(0.34,1.56,0.64,1) infinite;
}

.secondary-button:hover:not(:disabled) {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.line-button {
    background: linear-gradient(45deg, #00B900 0%, #00E600 100%);
    color: #fff;
}

.line-button:hover {
    background: #00A000;
}

/* Twitter Tasks */
.twitter-tasks {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.task-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.task-item.active {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
}

.task-item.completed {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.1);
}

.task-item.locked {
    opacity: 0.5;
    pointer-events: none;
}

.task-item.completed .secondary-button {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: rgba(100,100,100,0.3) !important;
}

.task-item.completed .secondary-button:hover {
    transform: none !important;
    background: rgba(100,100,100,0.3) !important;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.task-number {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.task-title {
    flex: 1;
    font-weight: 500;
}

.task-status {
    font-size: 20px;
}

.progress-info {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
    font-weight: 500;
}

/* Status Indicators */
.checking-status {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.small-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    animation: spin 1s linear infinite;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    border: 2px solid #5C4E00;
    animation: zoomIn 0.5s ease;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.success-animation {
    position: relative;
    margin-bottom: 20px;
}

.success-icon {
    font-size: 80px;
    animation: rotateIn 1s ease;
}

.confetti {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: url('data:image/svg+xml,<svg>...</svg>');
    opacity: 0.8;
}

.reward-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.reward-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.coupon-code {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 10px 0;
    border: 2px dashed #5C4E00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px;
}

.copy-btn {
    background: rgba(255,255,255,0.3);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.4);
}

.reward-value {
    font-size: 18px;
    color: #5C4E00;
    font-weight: 600;
}

.modal-actions {
    margin-top: 20px;
}

/* Image Instructions Modal */
.image-instructions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.image-instructions-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    border: 2px solid #5C4E00;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: slideIn 0.4s ease;
}

.instructions-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.instructions-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #5C4E00;
}

.instructions-description {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.instructions-steps {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

.instructions-steps p {
    font-weight: 500;
    margin-bottom: 10px;
    color: #5C4E00;
}

.instructions-steps ul {
    list-style: none;
    padding-left: 0;
}

.instructions-steps li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.instructions-steps li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #5C4E00;
}

.understand-btn {
    background: linear-gradient(45deg, #5C4E00 0%, #0D0A00 100%);
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
}

.understand-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* Alert Modal */
.alert-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.alert-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    border: 2px solid #5C4E00;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: slideIn 0.4s ease;
}

.alert-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.alert-message {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-button {
    background: linear-gradient(45deg, #5C4E00 0%, #0D0A00 100%);
    color: #000;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.alert-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
}

.alert-cancel {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes rotateIn {
    from {
        transform: rotate(0deg) scale(0);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes logoPulseUltraSmooth {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes btnJump {
    0%   { transform: translateY(0);}
    10%  { transform: translateY(-4px);}
    20%  { transform: translateY(-8px);}
    30%  { transform: translateY(-4px);}
    40%  { transform: translateY(0);}
    100% { transform: translateY(0);}
}

/* Responsive */
@media (max-width: 360px) {
    .header h1 {
        font-size: 24px;
    }
    
    .progress-step span {
        font-size: 10px;
    }
    
    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .step-card {
        padding: 20px;
    }
    
    .logo-icon img {
        width: 150px;
    }
}