/* CSS Variables for theming */
:root {
    --bg-color: #ffffff;
    --text-color: #202124;
    --header-bg: #ffffff;
    --footer-bg: #f2f2f2;
    --footer-border: #dadce0;
    --search-bg: #ffffff;
    --search-border: #dfe1e5;
    --search-hover-border: #4caf50;
    --button-bg: #f8f9fa;
    --button-hover-bg: #f1f3f4;
    --button-border: #f8f9fa;
    --link-color: #2e7d32;
    --link-hover-color: #388e3c;
    --primary-color: #2e7d32;
    --primary-hover: #388e3c;
    --accent-color: #4caf50;
    --compliance-bg: #f8f9fa;
    --compliance-border: #dadce0;
    --floating-msg-bg: #ffffff;
    --floating-msg-border: #dadce0;
}

/* Dark mode variables */
.dark-mode {
    --bg-color: #121212;
    --text-color: #e8eaed;
    --header-bg: #121212;
    --footer-bg: #1f1f1f;
    --footer-border: #3c4043;
    --search-bg: #303134;
    --search-border: #5f6368;
    --search-hover-border: #4caf50;
    --button-bg: #303134;
    --button-hover-bg: #3c4043;
    --button-border: #303134;
    --link-color: #4caf50;
    --link-hover-color: #66bb6a;
    --primary-color: #4caf50;
    --primary-hover: #66bb6a;
    --accent-color: #66bb6a;
    --compliance-bg: #1f1f1f;
    --compliance-border: #3c4043;
    --floating-msg-bg: #303134;
    --floating-msg-border: #5f6368;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: arial, sans-serif;
    font-size: 14px;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header (Google-style top bar) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px;
    height: 60px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--footer-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-link {
    color: #202124;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background-color 0.1s;
}

.header-link:hover {
    background-color: rgba(60, 64, 67, 0.08);
    text-decoration: none;
}

.header-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.1s;
}

.header-icon:hover {
    background-color: rgba(60, 64, 67, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
}

/* Login circle container */
.login-circle-container {
    position: relative;
    display: flex;
    align-items: center;
}

.login-circle {
    width: 32px;
    height: 32px;
    background: var(--button-bg);
    color: var(--text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.2s, background-color 0.2s;
    border: 1px solid var(--search-border);
    flex-shrink: 0;
}

.login-circle:hover {
    background: var(--button-hover-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Login dropdown */
.login-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--floating-msg-bg);
    border: 1px solid var(--floating-msg-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

/* Profile container */
.profile-container {
    position: relative;
}

.profile-circle {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.profile-circle:hover {
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

/* Profile dropdown */
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f3f4;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-icon {
    margin-right: 12px;
    font-size: 16px;
}

.dropdown-item span:last-child {
    font-size: 14px;
    color: #202124;
}

/* Main content (centered like Google) */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 120px);
    text-align: center;
}

/* Logo */
.logo {
    margin-bottom: 30px;
    display: block;
}

.logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 90px;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -3px;
    display: inline-block;
    line-height: 1;
    margin-bottom: 8px;
}

.tagline {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

/* Search container */
.search-container {
    width: 100%;
    max-width: 584px;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--search-border);
    border-radius: 24px;
    padding: 0 20px;
    height: 44px;
    background: var(--search-bg);
    transition: box-shadow 0.2s, border-color 0.3s ease, background-color 0.3s ease;
}

.search-box:hover {
    box-shadow: 0 2px 5px 1px rgba(64, 60, 67, 0.15);
    border-color: var(--search-hover-border);
}

.search-box:focus-within {
    box-shadow: 0 2px 5px 1px rgba(64, 60, 67, 0.15);
    border-color: var(--search-hover-border);
}


.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-color);
}


/* Search buttons */
.search-buttons {
    display: flex;
    justify-content: center;
    gap: 11px;
    margin-top: 30px;
}

.search-btn {
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--text-color);
    padding: 11px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.search-btn:hover {
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    background: var(--button-hover-bg);
    border-color: var(--search-border);
}

/* Login section */
.login-section {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 40px 20px;
}

.login-container h2 {
    font-size: 24px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 8px;
}

.login-container p {
    color: #5f6368;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background: #1557b0;
}

/* Result sections */
.result-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Preview section */
.preview-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    margin-top: 30px;
}

.preview-container {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 24px;
    text-align: left;
}

.preview-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.preview-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.preview-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: #1a73e8;
    margin: 0;
    text-decoration: none;
}

.preview-header h3:hover {
    text-decoration: underline;
}

.preview-header p {
    color: #5f6368;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.preview-meta {
    color: #70757a;
    font-size: 12px;
}

.preview-meta span {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.result-container {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.result-container h2 {
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 16px;
}

.link-display, .url-display {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.link-display input, .url-display input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    word-break: break-all;
}

.copy-btn, .go-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.copy-btn:hover, .go-btn:hover {
    background: #1557b0;
}

.success-message {
    color: #137333;
    font-size: 14px;
    font-weight: 500;
}

/* Floating Messages */
.floating-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.floating-message {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--floating-msg-border);
    background: var(--floating-msg-bg);
    color: var(--text-color);
    animation: slideIn 0.3s ease-out;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.floating-message:hover {
    transform: translateX(-5px);
}

.floating-message.success {
    background: #e6f4ea;
    color: #137333;
    border-color: #ceead6;
}

.floating-message.error {
    background: #fce8e6;
    color: #d93025;
    border-color: #f28b82;
}

.floating-message.info {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #aecbfa;
}

/* Animation for slide in */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation for slide out */
@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.floating-message.slide-out {
    animation: slideOut 0.3s ease-in forwards;
}

/* Footer (Google-style footer) */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-left, .footer-right {
    display: flex;
    gap: 30px;
}

.footer-center {
    display: flex;
    align-items: center;
}

.footer-link {
    color: #70757a;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background-color 0.1s;
}

.footer-link:hover {
    background-color: rgba(60, 64, 67, 0.08);
    text-decoration: none;
}

.footer-text {
    color: #70757a;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Secure Link Display Section */
.secure-link-display-section {
    width: 100%;
    max-width: 584px;
    margin: 30px auto;
    text-align: center;
}

.secure-link-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.secure-link-display {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--button-bg);
    border: 1px solid var(--search-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    word-break: break-all;
}

.secure-link-display:hover {
    background: var(--button-hover-bg);
    border-color: var(--search-hover-border);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.secure-link-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.secure-link-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* Secure by Design Section */
.secure-by-design-section {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.secure-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 12px;
    opacity: 0.7;
}

.compliance-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.compliance-badge {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 6px 12px;
    }
    
    .header-left .header-link:not(:first-child),
    .header-right .header-link:not(:last-child) {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .logo-text {
        font-size: 60px;
        letter-spacing: -2px;
    }
    
    .tagline {
        font-size: 16px;
    }
    
    .search-box {
        height: 40px;
    }
    
    .search-box input {
        font-size: 16px;
    }
    
    .link-display, .url-display {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-btn, .go-btn {
        width: 100%;
    }
    
    .footer {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-left, .footer-right {
        gap: 15px;
    }
}

/* Animation for smooth transitions */
.result-section {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Loading state */
.search-btn:disabled, .login-btn:disabled, .copy-btn:disabled, .go-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus styles for accessibility */
.search-btn:focus, .login-btn:focus, .copy-btn:focus, .go-btn:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

input:focus {
    outline: none;
}