/* Reset and Base Styles */
* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Form Styles */
.form-container, .search-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-container h2, .search-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Styles */
.location-btn, .generate-btn, .search-btn, .maps-btn, .share-btn, .copy-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.location-btn {
    background: #4CAF50;
    color: white;
    width: 100%;
    margin: 20px 0;
}

.location-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.generate-btn {
    background: #667eea;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.generate-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.search-btn {
    background: #FF6B6B;
    color: white;
    padding: 12px 20px;
}

.search-btn:hover {
    background: #ff5252;
}

.maps-btn {
    background: #4285F4;
    color: white;
}

.maps-btn:hover {
    background: #3367d6;
}

.share-btn {
    background: #34A853;
    color: white;
}

.share-btn:hover {
    background: #2d8f47;
}

.copy-btn {
    background: #FF9800;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

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

/* Search Input Group */
.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
}

/* Location Status */
.location-status {
    margin: 15px 0;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.location-status.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.location-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.location-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Map Container */
.map-container {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#map, #search-map {
    height: 300px;
    width: 100%;
}

.map-info {
    background: #e3f2fd;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
    color: #1565c0;
    font-size: 0.9rem;
}

/* Result Container */
.result-container, .search-result {
    margin-top: 30px;
    animation: slideIn 0.5s ease;
}

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

.result-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.result-card h3 {
    color: #28a745;
    margin-bottom: 20px;
    text-align: center;
}

.digital-address, .address-link {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.digital-address label, .address-link label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.address-code, .link-url {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
    word-break: break-all;
}

.location-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.location-info p {
    margin-bottom: 8px;
}

.location-info strong {
    color: #495057;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    margin-top: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tab-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 200px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions button {
        width: 100%;
    }
    
    #map, #search-map {
        height: 250px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .form-container, .search-container {
        padding: 0;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
.success-checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.success-checkmark::after {
    content: '✓';
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

/* Hover Effects */
.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* Copy Success Feedback */
.copy-success {
    background: #d4edda !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

.copy-success::after {
    content: ' ✓ Copied!';
    font-size: 0.8rem;
}