/* ==========================================
   IQ PWA - Components Styles
   UI Components matching Android App
   ========================================== */

/* Modern Cards */
.card {
    background: var(--surface-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-md);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 193, 7, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--gold-primary);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Glass Card Variant */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Premium Card */
.card-premium {
    background: linear-gradient(135deg, var(--surface-light), var(--surface-variant-light));
    border: 1px solid var(--gold-primary);
    box-shadow: var(--shadow-glow);
}

/* Dark Mode Cards */
.dark-mode .card {
    background: var(--surface-dark);
    border-color: rgba(255, 193, 7, 0.2);
}

.dark-mode .card-glass {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--surface-variant-light);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.card-body {
    color: var(--text-primary);
}

.card-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--surface-variant-light);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: var(--text-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.balance-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.balance-currency {
    font-size: 1.25rem;
    margin-right: var(--spacing-sm);
    opacity: 0.95;
}

.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
}

.balance-info-item {
    text-align: center;
}

.balance-info-value {
    font-size: 1.125rem;
    font-weight: 600;
    display: block;
}

.balance-info-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Harvest Card */
.harvest-card {
    background: linear-gradient(135deg, var(--harvest-green) 0%, var(--accent-green-dark) 100%);
    color: var(--text-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.harvest-timer {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto var(--spacing-lg);
}

.harvest-circle {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.harvest-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

.harvest-circle-progress {
    fill: none;
    stroke: var(--text-light);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.harvest-time {
    font-size: 2rem;
    font-weight: 700;
}

.harvest-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.harvest-btn {
    background: var(--surface-light);
    color: var(--harvest-green);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-round);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.harvest-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-large);
}

.harvest-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.feature-card {
    background: var(--surface-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-sm);
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.feature-icon.gold { background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%); }
.feature-icon.blue { background: linear-gradient(135deg, var(--package-blue) 0%, var(--accent-blue-dark) 100%); }
.feature-icon.orange { background: linear-gradient(135deg, var(--wheel-orange) 0%, #F57C00 100%); }
.feature-icon.purple { background: linear-gradient(135deg, var(--agent-purple) 0%, #7B1FA2 100%); }
.feature-icon.green { background: linear-gradient(135deg, var(--harvest-green) 0%, var(--accent-green-dark) 100%); }

.feature-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.feature-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1);
}

.btn-secondary {
    background: rgba(255, 193, 7, 0.1);
    color: var(--gold-primary);
    border: 2px solid var(--gold-primary);
}

.btn-secondary:hover {
    background: var(--gold-primary);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-success {
    background: var(--green-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-red) 0%, var(--error-red-dark) 100%);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-outlined {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 2px solid var(--gold-primary);
    color: var(--gold-primary);
}

.btn-outlined:hover {
    background: var(--gold-gradient);
    color: var(--text-light);
    border-color: transparent;
    transform: translateY(-3px) scale(1.02);
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.btn-icon:hover {
    background: var(--gold-primary);
    color: var(--text-light);
    transform: rotate(90deg) scale(1.1);
}

.btn-floating {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gold-gradient);
    color: var(--text-light);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-fixed);
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--surface-variant-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface-light);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-error {
    font-size: 0.75rem;
    color: var(--error-red);
    margin-top: var(--spacing-xs);
}

.form-helper {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-large);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease;
}

.toast.success {
    background: var(--accent-green);
    color: var(--text-light);
}

.toast.error {
    background: var(--error-red);
    color: var(--text-light);
}

.toast.warning {
    background: var(--wheel-orange);
    color: var(--text-light);
}

.toast.info {
    background: var(--accent-blue);
    color: var(--text-light);
}

@keyframes toast-slide-in {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* Coming Soon Page */
.coming-soon-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.coming-soon-content {
    text-align: center;
    max-width: 500px;
}

.coming-soon-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    animation: pulse-icon 2s ease-in-out infinite;
}

.coming-soon-icon .material-icons {
    font-size: 64px;
    color: white;
}

.coming-soon-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.coming-soon-text {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-weight: 600;
}

.dark-mode .coming-soon-text {
    color: var(--text-light);
}

.coming-soon-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 48px rgba(102, 126, 234, 0.5);
    }
}

/* Email Verification Modal */
.verification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.verification-dialog {
    background: var(--surface-light);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.dark-mode .verification-dialog {
    background: var(--surface-dark);
}

.verification-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-icon .material-icons {
    font-size: 40px;
    color: #667EEA;
}

.verification-dialog h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.dark-mode .verification-dialog h3 {
    color: var(--text-light);
}

.verification-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.verification-email {
    font-size: 13px;
    color: #667EEA;
    margin: 0 0 24px 0;
    font-weight: 600;
}

.verification-code-input {
    margin-bottom: 16px;
}

.verification-code-input input {
    width: 100%;
    height: 56px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dark-mode .verification-code-input input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.verification-code-input input:focus {
    outline: none;
    border-color: #667EEA;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.verification-error {
    color: #F44336;
    font-size: 13px;
    margin: -8px 0 16px 0;
    padding: 8px 12px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
}

.verification-resend {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.verification-resend p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.verification-resend .btn-link {
    background: none;
    border: none;
    color: #667EEA;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.verification-resend .btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-variant-light) 25%,
        rgba(255, 255, 255, 0.5) 50%,
        var(--surface-variant-light) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.loading-content {
    background: var(--surface-light);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-large);
}

.loading-message {
    margin-top: var(--spacing-md);
    color: var(--text-primary);
    font-size: 1rem;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: var(--spacing-lg);
    left: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--surface-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-large);
    z-index: var(--z-popover);
    animation: slide-up 0.3s ease;
}

.install-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.install-icon {
    font-size: 32px;
    color: var(--gold-primary);
}

.install-text {
    flex: 1;
}

.install-text h4 {
    font-size: 1rem;
    margin: 0 0 var(--spacing-xs);
}

.install-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.install-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--gold-primary);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
}

.install-later {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(-20px, -20px);
    }
    50% {
        transform: translate(20px, -10px);
    }
    75% {
        transform: translate(-10px, 20px);
    }
}
