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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://i.ibb.co/8npQLpNN/dwd.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(3px);
    opacity: 0.3;
    z-index: -1;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    margin: 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.form-container {
    margin-bottom: 2rem;
}

.url-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.url-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    outline: none;
    background: #f8f9fa;
    border-radius: 12px 0 0 12px;
    transition: all 0.3s ease;
}

.url-input:focus {
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.url-input::placeholder {
    color: #6c757d;
    font-weight: 500;
}

.submit-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid #667eea;
    border-left: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0 12px 12px 0;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a1 100%);
    transform: translateY(-1px);
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.icon {
    font-size: 1.2rem;
}

.result-container {
    animation: slideIn 0.5s ease;
}

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

.result-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.result-box label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.url-result {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.result-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    background: white;
    font-size: 0.9rem;
    outline: none;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #218838;
}

.hint {
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

footer p {
    color: #6c757d;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        margin: 0.5rem;
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .url-input {
        border-radius: 12px 12px 0 0;
    }
    
    .submit-btn {
        border-radius: 0 0 12px 12px;
        padding: 1.25rem;
    }
    
    .url-result {
        flex-direction: column;
    }
    
    .result-input {
        border-radius: 8px 8px 0 0;
    }
    
    .copy-btn {
        border-radius: 0 0 8px 8px;
        padding: 1rem;
    }
}

.nav-buttons {
    margin-top: 1rem;
}

.nav-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.action-buttons {
    margin-top: 1rem;
    text-align: center;
}

.stats-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #17a2b8;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.stats-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.create-link-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.create-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.links-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.link-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.link-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.link-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0;
}

.clicks-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.url-section {
    margin-bottom: 1rem;
}

.url-section label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.url-display {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.url-input-readonly {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    background: white;
    font-size: 0.85rem;
    outline: none;
    color: #495057;
}

.copy-btn-small {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-btn-small:hover {
    background: #218838;
}

.original-url {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.original-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.85rem;
}

.original-link:hover {
    text-decoration: underline;
}

.link-meta {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.link-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.action-btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.visit-btn {
    background: #667eea;
    color: white;
}

.visit-btn:hover {
    background: #5a67d8;
}

.summary {
    margin-top: 2rem;
}

.summary-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.stats-container {
    max-width: 800px;
    margin: 0 auto;
}

.stats-header {
    text-align: center;
    margin-bottom: 2rem;
}

.short-code-display {
    margin-top: 1rem;
}

.code-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.short-code {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #495057;
    border: 2px solid #e9ecef;
}

.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.main-stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.big-number {
    font-size: 3rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.main-stat .stat-value {
    color: white;
}

.stat-sub {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.url-info {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.url-info h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.url-actions {
    margin-top: 0.5rem;
}

.original-url-display {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.75rem;
}

.original-link-full {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.original-link-full:hover {
    text-decoration: underline;
}

.performance-info {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
}

.performance-info h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.performance-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.perf-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.perf-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.status-active {
    color: #28a745;
}

/* 페이지네이션 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.pagination-btn {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.pagination-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.page-current {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.page-total {
    font-weight: 500;
    color: #2c3e50;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* 인증 버튼 스타일 */
.auth-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid #667eea;
}

.btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a1 100%);
}

.btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}