/* ===== 首頁 (index.html) 專屬樣式 ===== */

body {
    background: linear-gradient(135deg, var(--bg-green) 0%, #ffffff 100%);
    min-height: 100vh;
    font-family: 'Inter', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

/* Header / Brand Section */
.brand-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.brand-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    text-decoration: none;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.brand-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.brand-text p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

.brand-nav {
    display: flex;
    gap: 20px;
}

.brand-nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.brand-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.brand-nav .btn-admin {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

/* Main Container */
.main-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-title .highlight {
    color: var(--primary-green);
    position: relative;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 30px;
}

/* Main Card */
.main-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.1);
    margin-bottom: 30px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary-green);
}

/* Form Controls */
.form-control, .input-group-text {
    border-color: #d1fae5;
    font-size: 15px;
    padding: 14px 16px;
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.15);
}

.input-group-text {
    background: var(--bg-green);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Mode Selection */
.mode-selection {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option:hover {
    border-color: var(--light-green);
    background: var(--bg-green);
}

.mode-option.active {
    border-color: var(--primary-green);
    background: var(--bg-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.mode-icon {
    font-size: 24px;
}

.mode-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mode-option.active .mode-text {
    color: var(--primary-green);
}

/* Custom Code Section */
.custom-code-section {
    background: var(--bg-green);
    border: 2px dashed var(--light-green);
    border-radius: 16px;
    padding: 24px;
    margin: 0;
}

.custom-code-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pro-badge {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-input-wrapper {
    position: relative;
}

.code-input {
    padding-right: 45px !important;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.code-feedback {
    font-size: 14px;
    margin-top: 8px;
    min-height: 24px;
    font-weight: 500;
}

.code-feedback.checking {
    color: var(--gray);
}

.code-feedback.available {
    color: var(--success);
}

.code-feedback.unavailable {
    color: var(--error);
}

.code-preview {
    background: white;
    border: 2px solid var(--primary-green);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    color: var(--dark-green);
    font-weight: 600;
    word-break: break-all;
}

/* Primary Button */
.btn-primary-green {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    border: none;
    color: white;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    width: 100%;
}

.btn-primary-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.4);
}

.btn-primary-green:disabled {
    background: var(--gray);
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

/* Alert */
.alert {
    border-radius: 8px;
    border: none;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid transparent;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left-color: #3b82f6;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

/* Result Box */
.result-box {
    background: var(--surface);
    border: 2px solid var(--primary-green);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    animation: slideIn 0.5s ease-out;
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--primary-green);
    font-size: 18px;
    font-weight: 600;
}

.short-url-display {
    background: var(--bg-green);
    border-radius: 12px;
    padding: 20px;
    display: block;
    margin-bottom: 20px;
}

.url-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green);
    word-break: break-all;
    display: block;
}

.copy-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--dark-green);
    transform: scale(1.05);
}

.qr-section {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

.qr-section img {
    max-width: 180px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Statistics Card */
.stats-card {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: white;
    border-radius: 20px;
    padding: 16px 20px;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.2);
}

.stats-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.9;
}

.stats-content {
    font-size: 15px;
    line-height: 1.4;
}

.stats-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--mint-green);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 40px 20px 20px;
    margin-top: 15px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--mint-green);
}

.footer-section p, .footer-section a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: var(--mint-green);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: var(--mint-green);
    text-decoration: none;
    font-weight: 600;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.custom-toast {
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease-out;
}

.custom-toast i {
    font-size: 20px;
    color: var(--primary-green);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .main-card { padding: 24px; }
    .brand-nav { display: none; }
    .short-url-display { flex-direction: column; gap: 16px; }
    .copy-btn { width: 100%; justify-content: center; }
}
