/* ========================================
   Grams Converter Tool - Main Stylesheet
   ======================================== */

:root {
    --primary-color: #c2f711;
    --secondary-color: #5e5e5e;
    --text-dark: #1a1a1a;
    --text-light: #f5f5f5;
    --bg-light: #ffffff;
    --bg-dark: #2a2a2a;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(194, 247, 17, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* Page Transition Animation */
.page-transition {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header & Navigation */
header {
    background-color: var(--bg-light);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), #a8d60f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-light);
    box-shadow: var(--shadow);
    border-radius: 8px;
    padding: 1rem;
    min-width: 250px;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: var(--primary-color);
    color: var(--text-dark);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f8f9fa 100%);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="%23c2f711" opacity="0.1"/></svg>');
    animation: float 20s infinite linear;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(-20px) translateX(20px); }
    66% { transform: translateY(20px) translateX(-20px); }
    100% { transform: translateY(0) translateX(0); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-dark);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Converter Tool Container */
.converter-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.converter-header {
    text-align: center;
    margin-bottom: 2rem;
}

.converter-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.converter-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.converter-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.input-group input,
.input-group select {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(194, 247, 17, 0.1);
}

.swap-btn {
    background-color: var(--secondary-color);
    color: var(--bg-light);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-dark);
    transform: rotate(180deg);
}

.result-box {
    background: linear-gradient(135deg, var(--primary-color), #a8d60f);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
    color: var(--text-dark);
}

.result-box h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.result-box p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.copy-btn {
    margin-top: 1rem;
    background-color: var(--text-dark);
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.history-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.history-section h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.history-list {
    list-style: none;
}

.history-item {
    padding: 0.75rem;
    background-color: #f8f9fa;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.tool-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tool-card p {
    color: var(--secondary-color);
}

/* Content Sections */
.content-section {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
}

.content-section h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-section h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section p,
.content-section li {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    line-height: 1.8;
}

.content-section ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

/* FAQ Section */
.faq-section {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
}

.faq-item {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-question {
    padding: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
}

.faq-question:hover {
    background-color: rgba(194, 247, 17, 0.1);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--secondary-color);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 1.5rem;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-column p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-column a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: var(--text-dark);
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(194, 247, 17, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--bg-light);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .converter-form {
        grid-template-columns: 1fr;
    }

    .swap-btn {
        margin: 0 auto;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden {
    display: none;
}

